|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jfw.web.util.LocaleCookie
public final class LocaleCookie
Manage locale cookie.
Field Summary | |
---|---|
static int |
COOKIE_AGE_BROWSER
Cookie exist until browser is closed. |
static int |
COOKIE_DELETE
Cookie is deleted. |
static java.lang.String |
COOKIE_NAME
Default locale cookie name. |
static java.lang.String |
COOKIE_SEPARATOR
Separator char for cookie values. |
Constructor Summary | |
---|---|
LocaleCookie()
|
Method Summary | |
---|---|
static void |
delete(javax.servlet.http.HttpServletResponse response)
Use method delete(javax.servlet.http.HttpServletResponse, java.lang.String) . |
static void |
delete(javax.servlet.http.HttpServletResponse response,
java.lang.String cookieName)
Delete locale cookie. |
static java.util.Locale |
read(javax.servlet.http.HttpServletRequest request)
Use method read(javax.servlet.http.HttpServletRequest, java.lang.String) . |
static java.util.Locale |
read(javax.servlet.http.HttpServletRequest request,
java.lang.String cookieName)
Read locale cookie. |
static void |
write(javax.servlet.http.HttpServletResponse response,
java.util.Locale locale)
Use method write(javax.servlet.http.HttpServletResponse, java.util.Locale, java.lang.String, java.lang.String, java.lang.String, java.lang.String, int) . |
static void |
write(javax.servlet.http.HttpServletResponse response,
java.util.Locale locale,
java.lang.String cookieName,
java.lang.String cookieDomain,
java.lang.String cookiePath,
java.lang.String cookieSecure,
int cookieAge)
Write the locale cookie. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String COOKIE_NAME
public static final int COOKIE_AGE_BROWSER
public static final int COOKIE_DELETE
public static final java.lang.String COOKIE_SEPARATOR
Constructor Detail |
---|
public LocaleCookie()
Method Detail |
---|
public static java.util.Locale read(javax.servlet.http.HttpServletRequest request, java.lang.String cookieName)
request
- an HttpServletRequest object.cookieName
- cookie name. If null COOKIE_NAME
is used.
public static java.util.Locale read(javax.servlet.http.HttpServletRequest request)
read(javax.servlet.http.HttpServletRequest, java.lang.String)
. The default value of parameter cookieName
is COOKIE_NAME
.
public static void write(javax.servlet.http.HttpServletResponse response, java.util.Locale locale, java.lang.String cookieName, java.lang.String cookieDomain, java.lang.String cookiePath, java.lang.String cookieSecure, int cookieAge)
response
- an HttpServletResponse object.locale
- a Locale object.cookieName
- cookie name. If null COOKIE_NAME
is used.cookieDomain
- cokie domain. If null is not used.cookiePath
- cokie path. If null is not used.cookieSecure
- cokie secure option. If null is not used.cookieAge
- cokie age. A integer value > 0 indicates the msecs before
cookie expire. If value is COOKIE_AGE_BROWSER
cookie is not stored
and expire when browser is closed.public static void write(javax.servlet.http.HttpServletResponse response, java.util.Locale locale)
write(javax.servlet.http.HttpServletResponse, java.util.Locale, java.lang.String, java.lang.String, java.lang.String, java.lang.String, int)
.COOKIE_NAME
.COOKIE_AGE_BROWSER
.
public static void delete(javax.servlet.http.HttpServletResponse response, java.lang.String cookieName)
response
- an HttpServletResponse object.cookieName
- cookie name. If null COOKIE_NAME
is used.public static void delete(javax.servlet.http.HttpServletResponse response)
delete(javax.servlet.http.HttpServletResponse, java.lang.String)
.COOKIE_NAME
.
response
- an HttpServletResponse object.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |