org.springframework.web.util
类 CookieGenerator<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
java.lang.Object
<?xml:namespace prefix = v ns = "urn:schemas-microsoft-com:vml" /><shapetype id="_x0000_t75" stroked="f" filled="f" path="m@4@5l@4@11@9@11@9@5xe" o:preferrelative="t" o:spt="75" coordsize="21600,21600"><stroke joinstyle="miter"><formulas><f eqn="if lineDrawn pixelLineWidth 0"><f eqn="sum @0 1 0"><f eqn="sum 0 0 @1"><f eqn="prod @2 1 2"><f eqn="prod @3 21600 pixelWidth"><f eqn="prod @3 21600 pixelHeight"><f eqn="sum @0 0 1"><f eqn="prod @6 1 2"><f eqn="prod @7 21600 pixelWidth"><f eqn="sum @8 21600 0"><f eqn="prod @7 21600 pixelHeight"><f eqn="sum @10 21600 0"></f></f></f></f></f></f></f></f></f></f></f></f></formulas><path o:connecttype="rect" gradientshapeok="t" o:extrusionok="f"><lock aspectratio="t" v:ext="edit"></lock></path></stroke></shapetype><shape style="width: 11.25pt; height: 10.5pt; visibility: visible; mso-wrap-style: square;" id="图片_x0020_1" alt="说明: 继承者 " type="#_x0000_t75" o:spid="_x0000_i1040"><imagedata o:title="继承者 " src="file:///C:%5CUsers%5Cdev1%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_image001.gif"></imagedata></shape>org.springframework.web.util.CookieGenerator
直接已知子类:
CookieLocaleResolver, CookieThemeResolver
public class CookieGenerator
extends java.lang.Object
辅助类生成的饼干,饼干账面bean属性描述符设置,能够添加和移除Cookie到/从一个给定的响应。
可以作为基地组件,生成特定的Cookie一样CookieLocaleResolcer和CookieThemeResolver级。
英文注释
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.
从以下版本开始:
1.1.4
作者:
Juergen Hoeller
另请参见:
addCookie(javax.servlet.http.HttpServletResponse, java.lang.String), removeCookie(javax.servlet.http.HttpServletResponse), CookieLocaleResolver, CookieThemeResolver
static int |
DEFAULT_COOKIE_MAX_AGE |
static java.lang.String |
DEFAULT_COOKIE_PATH |
构造方法摘要 |
|
方法摘要 |
|
void |
addCookie(javax.servlet.http.HttpServletResponse response, java.lang.String cookieValue) |
java.lang.String |
getCookieDomain() |
int |
getCookieMaxAge() |
java.lang.String |
getCookieName() |
java.lang.String |
getCookiePath() |
boolean |
isCookieSecure() |
void |
removeCookie(javax.servlet.http.HttpServletResponse response) |
void |
setCookieDomain(java.lang.String cookieDomain) |
void |
setCookieMaxAge(int cookieMaxAge) |
void |
setCookieName(java.lang.String cookieName) |
void |
setCookiePath(java.lang.String cookiePath) |
void |
setCookieSecure(boolean cookieSecure) |
从类 java.lang.Object 继承的方法 |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
字段详细信息 |
public static final java.lang.String DEFAULT_COOKIE_PATH
默认路径的cookie将是可见的:“/”,即整个服务器。
英文注释
Default path that cookies will be visible to: "/", i.e. the entire server.
另请参见:
public static final int DEFAULT_COOKIE_MAX_AGE
Cookie的默认最大年龄:最大整数值,即永远。
英文注释
Default maximum age of cookies: maximum integer value, i.e. forever.
另请参见:
public CookieGenerator()
public void setCookieName(java.lang.String cookieName)
使用这个生成器创建的Cookie的名字。
英文注释
Use the given name for cookies created by this generator.
public java.lang.String getCookieName()
返回由这个生成器创建的Cookie的名字。
英文注释
Return the given name for cookies created by this generator.
public void setCookieDomain(java.lang.String cookieDomain)
使用这个生成器创建的Cookie的定域。 Cookie是唯一可见的这个域服务器。
英文注释
Use the given domain for cookies created by this generator. The cookie is only visible to servers in this domain.
public java.lang.String getCookieDomain()
返回由这个生成器创建的cookie的域,如果有的话。
英文注释
Return the domain for cookies created by this generator, if any.
public void setCookiePath(java.lang.String cookiePath)
使用这个生成器创建的饼干给定的路径。 Cookie是唯一可见在这条道路和下面的网址。
英文注释
Use the given path for cookies created by this generator. The cookie is only visible to URLs in this path and below.
public java.lang.String getCookiePath()
返回由这个生成器创建的cookie的路径。
英文注释
Return the path for cookies created by this generator.
public void setCookieMaxAge(int cookieMaxAge)
使用给定的最大生成器创建的cookie这个年龄(单位:秒)。有用的特殊值:-1 ...不是永久性的,客户端关闭时删除
英文注释
Use the given maximum age (in seconds) for cookies created by this generator. Useful special value: -1 ... not persistent, deleted when client shuts down
public int getCookieMaxAge()
返回由这个生成器创建的Cookie的最高年龄。
英文注释
Return the maximum age for cookies created by this generator.
public void setCookieSecure(boolean cookieSecure)
设置cookie是否应该只发送使用,如HTTPS(SSL)的安全协议。这是一个浏览器显示到接收,而不是由HTTP服务器本身的处理。默认为“假”。
英文注释
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".
public boolean isCookieSecure()
返回cookie是否应该只发送使用,如HTTPS(SSL)的安全协议。
英文注释
Return whether the cookie should only be sent using a secure protocol, such as HTTPS (SSL).
public void addCookie(javax.servlet.http.HttpServletResponse response,
java.lang.String cookieValue)
与给定值添加到响应的Cookie,使用这种发电机描述符设置的cookie。
代表们createCookie用于Cookie创作。
参数:
response - HTTP响应添加cookie来
cookieValue - cookie的值增加
英文注释
Add a cookie with the given value to the response, using the cookie descriptor settings of this generator.
Delegates to createCookie for cookie creation.
response - the HTTP response to add the cookie to
cookieValue - the value of the cookie to add
另请参见:
setCookieName(java.lang.String), setCookieDomain(java.lang.String), setCookiePath(java.lang.String), setCookieMaxAge(int), createCookie(java.lang.String)
public void removeCookie(javax.servlet.http.HttpServletResponse response)
删除生成的cookie,这从响应描述。将生成一个空值和最大年龄0的cookie。
代表们createCookie用于Cookie创作。
参数:
response - HTTP响应中删除的cookie从
英文注释
Remove the cookie that this generator describes from the response. Will generate a cookie with empty value and max age 0.
Delegates to createCookie for cookie creation.
response - the HTTP response to remove the cookie from
另请参见:
setCookieName(java.lang.String), setCookieDomain(java.lang.String), setCookiePath(java.lang.String), createCookie(java.lang.String)