[jboss-cvs] jboss-seam/src/main/org/jboss/seam/core ...
Gavin King
gavin.king at jboss.com
Sat Nov 25 22:22:59 EST 2006
User: gavin
Date: 06/11/25 22:22:59
Modified: src/main/org/jboss/seam/core LocaleSelector.java
TimeZoneSelector.java
Log:
fix JBSEAM-525
Revision Changes Path
1.16 +14 -1 jboss-seam/src/main/org/jboss/seam/core/LocaleSelector.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: LocaleSelector.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/core/LocaleSelector.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -b -r1.15 -r1.16
--- LocaleSelector.java 24 Nov 2006 23:15:17 -0000 1.15
+++ LocaleSelector.java 26 Nov 2006 03:22:59 -0000 1.16
@@ -46,6 +46,7 @@
private String variant;
private boolean cookieEnabled;
+ private int cookieMaxAge = 31536000; //1 year
@Create
public void initLocale()
@@ -69,7 +70,9 @@
if (cookieEnabled)
{
HttpServletResponse response = (HttpServletResponse) FacesContext.getCurrentInstance().getExternalContext().getResponse();
- response.addCookie( new Cookie( "org.jboss.seam.core.Locale", getLocaleString() ) );
+ Cookie cookie = new Cookie( "org.jboss.seam.core.Locale", getLocaleString() );
+ cookie.setMaxAge(cookieMaxAge);
+ response.addCookie(cookie);
}
}
@@ -209,4 +212,14 @@
this.cookieEnabled = cookieEnabled;
}
+ protected int getCookieMaxAge()
+ {
+ return cookieMaxAge;
+ }
+
+ protected void setCookieMaxAge(int cookieMaxAge)
+ {
+ this.cookieMaxAge = cookieMaxAge;
+ }
+
}
1.6 +14 -1 jboss-seam/src/main/org/jboss/seam/core/TimeZoneSelector.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: TimeZoneSelector.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/core/TimeZoneSelector.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- TimeZoneSelector.java 24 Nov 2006 23:15:17 -0000 1.5
+++ TimeZoneSelector.java 26 Nov 2006 03:22:59 -0000 1.6
@@ -34,6 +34,7 @@
private String id;
private boolean cookieEnabled;
+ private int cookieMaxAge = 31536000; //1 year
@Create
public void initTimeZone()
@@ -54,7 +55,9 @@
if (cookieEnabled)
{
HttpServletResponse response = (HttpServletResponse) FacesContext.getCurrentInstance().getExternalContext().getResponse();
- response.addCookie( new Cookie( "org.jboss.seam.core.TimeZone", getTimeZoneId() ) );
+ Cookie cookie = new Cookie( "org.jboss.seam.core.TimeZone", getTimeZoneId() );
+ cookie.setMaxAge(cookieMaxAge);
+ response.addCookie(cookie);
}
}
@@ -106,4 +109,14 @@
this.cookieEnabled = cookieEnabled;
}
+ protected int getCookieMaxAge()
+ {
+ return cookieMaxAge;
+ }
+
+ protected void setCookieMaxAge(int cookieMaxAge)
+ {
+ this.cookieMaxAge = cookieMaxAge;
+ }
+
}
More information about the jboss-cvs-commits
mailing list