Author: ivassile
Date: 2012-11-27 17:12:03 -0500 (Tue, 27 Nov 2012)
New Revision: 15371
Modified:
branches/enterprise/JBPAPP_5_1_1_JBPAPP-10456/ui/src/main/java/org/jboss/seam/ui/ClientUidSelector.java
Log:
JBPAPP-7183 backed port fix for ClientUidSelector. One-off JBPAPP-10456
Modified:
branches/enterprise/JBPAPP_5_1_1_JBPAPP-10456/ui/src/main/java/org/jboss/seam/ui/ClientUidSelector.java
===================================================================
---
branches/enterprise/JBPAPP_5_1_1_JBPAPP-10456/ui/src/main/java/org/jboss/seam/ui/ClientUidSelector.java 2012-11-27
21:39:33 UTC (rev 15370)
+++
branches/enterprise/JBPAPP_5_1_1_JBPAPP-10456/ui/src/main/java/org/jboss/seam/ui/ClientUidSelector.java 2012-11-27
22:12:03 UTC (rev 15371)
@@ -20,12 +20,20 @@
@Name("org.jboss.seam.ui.clientUidSelector")
public class ClientUidSelector extends Selector
{
+
+ private static final long serialVersionUID = 816459544346114991L;
+
private String clientUid;
@Create
public void onCreate()
{
-
setCookiePath(FacesContext.getCurrentInstance().getExternalContext().getRequestContextPath());
+ String requestContextPath =
FacesContext.getCurrentInstance().getExternalContext().getRequestContextPath();
+ if (requestContextPath.isEmpty())
+ {
+ requestContextPath = "/";
+ }
+ setCookiePath(requestContextPath);
setCookieMaxAge(-1);
setCookieEnabled(true);
clientUid = getCookieValue();
@@ -34,7 +42,7 @@
public void seed()
{
if (!isSet()) {
- clientUid = RandomStringUtils.randomAscii(50);
+ clientUid = RandomStringUtils.random(50, true, true);
setCookieValueIfEnabled(clientUid);
}
}