public static class CookieSerializer.CookieValue
extends java.lang.Object
HttpServletResponse
.Constructor and Description |
---|
CookieValue(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.lang.String cookieValue)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
int |
getCookieMaxAge()
Get the cookie max age.
|
java.lang.String |
getCookieValue()
The value to be written.
|
javax.servlet.http.HttpServletRequest |
getRequest()
Gets the request to use.
|
javax.servlet.http.HttpServletResponse |
getResponse()
Gets the response to write to.
|
void |
setCookieMaxAge(int cookieMaxAge)
Set the cookie max age.
|
public CookieValue(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String cookieValue)
request
- the HttpServletRequest
to use. Useful for determining
the context in which the cookie is set. Cannot be null.response
- the HttpServletResponse
to use.cookieValue
- the value of the cookie to be written. This value may be
modified by the CookieSerializer
when writing to the actual cookie so
long as the original value is returned when the cookie is read.public javax.servlet.http.HttpServletRequest getRequest()
public javax.servlet.http.HttpServletResponse getResponse()
public java.lang.String getCookieValue()
CookieSerializer
before written to the cookie. However, the value must
be the same as the original when it is read back in.public int getCookieMaxAge()
public void setCookieMaxAge(int cookieMaxAge)
cookieMaxAge
- the cookie max age