| java.lang.Object org.springframework.web.util.CookieGenerator
CookieGenerator | public class CookieGenerator (Code) | | Helper class for cookie generation, carrying cookie descriptor settings
as bean properties and being able to add and remove cookie to/from a
given response.
Can serve as base class for components that generate specific cookies,
like CookieLocaleResolcer and CookieThemeResolver.
author: Juergen Hoeller since: 1.1.4 See Also: CookieGenerator.addCookie See Also: CookieGenerator.removeCookie See Also: org.springframework.web.servlet.i18n.CookieLocaleResolver See Also: org.springframework.web.servlet.theme.CookieThemeResolver |
Method Summary | |
public void | addCookie(HttpServletResponse response, String cookieValue) Add a cookie with the given value to the response,
using the cookie descriptor settings of this generator. | protected Cookie | createCookie(String cookieValue) Create a cookie with the given value, using the cookie descriptor
settings of this generator (except for "cookieMaxAge"). | public String | getCookieDomain() Return the domain for cookies created by this generator, if any. | public int | getCookieMaxAge() Return the maximum age for cookies created by this generator. | public String | getCookieName() Return the given name for cookies created by this generator. | public String | getCookiePath() Return the path for cookies created by this generator. | public boolean | isCookieSecure() Return whether the cookie should only be sent using a secure protocol,
such as HTTPS (SSL). | public void | removeCookie(HttpServletResponse response) Remove the cookie that this generator describes from the response. | public void | setCookieDomain(String cookieDomain) Use the given domain for cookies created by this generator. | public void | setCookieMaxAge(int cookieMaxAge) Use the given maximum age (in seconds) for cookies created by this generator.
Useful special value: -1 ... | public void | setCookieName(String cookieName) Use the given name for cookies created by this generator. | public void | setCookiePath(String cookiePath) Use the given path for cookies created by this generator. | public void | setCookieSecure(boolean cookieSecure) Set whether the cookie should only be sent using a secure protocol,
such as HTTPS (SSL). |
DEFAULT_COOKIE_MAX_AGE | final public static int DEFAULT_COOKIE_MAX_AGE(Code) | | Default maximum age of cookies: maximum integer value, i.e. forever.
|
DEFAULT_COOKIE_PATH | final public static String DEFAULT_COOKIE_PATH(Code) | | Default path that cookies will be visible to: "/", i.e. the entire server.
|
logger | final protected Log logger(Code) | | |
getCookieDomain | public String getCookieDomain()(Code) | | Return the domain for cookies created by this generator, if any.
|
getCookieMaxAge | public int getCookieMaxAge()(Code) | | Return the maximum age for cookies created by this generator.
|
getCookieName | public String getCookieName()(Code) | | Return the given name for cookies created by this generator.
|
getCookiePath | public String getCookiePath()(Code) | | Return the path for cookies created by this generator.
|
isCookieSecure | public boolean isCookieSecure()(Code) | | Return whether the cookie should only be sent using a secure protocol,
such as HTTPS (SSL).
|
setCookieDomain | public void setCookieDomain(String cookieDomain)(Code) | | Use the given domain for cookies created by this generator.
The cookie is only visible to servers in this domain.
|
setCookieMaxAge | public void setCookieMaxAge(int cookieMaxAge)(Code) | | Use the given maximum age (in seconds) for cookies created by this generator.
Useful special value: -1 ... not persistent, deleted when client shuts down
|
setCookieName | public void setCookieName(String cookieName)(Code) | | Use the given name for cookies created by this generator.
|
setCookiePath | public void setCookiePath(String cookiePath)(Code) | | Use the given path for cookies created by this generator.
The cookie is only visible to URLs in this path and below.
|
setCookieSecure | public void setCookieSecure(boolean cookieSecure)(Code) | | Set whether the cookie should only be sent using a secure protocol,
such as HTTPS (SSL). This is an indication to the receiving browser,
not processed by the HTTP server itself. Default is "false".
|
|
|