public class ServerCookie extends Object
org.apache.tomcat.util.http.ServerCookie
改编。
Server-side cookie representation. Allows recycling and uses MessageBytes as low-level representation ( and thus the byte-> char conversion can be delayed until we know the charset ). Tomcat.core uses this recyclable object to represent cookies, and the facade will convert it to the external representation.
Modifier and Type | Field and Description |
---|---|
static boolean |
ALWAYS_ADD_EXPIRES
If set to false, we don't use the IE6/7 Max-Age/Expires work around
|
static boolean |
STRICT_SERVLET_COMPLIANCE
If set to true, we parse cookies according to the servlet spec,
|
Constructor and Description |
---|
ServerCookie() |
Modifier and Type | Method and Description |
---|---|
static boolean |
alreadyQuoted(String value) |
static void |
appendCookieValue(StringBuilder buf,
int version,
String name,
String value,
String path,
String domain,
String comment,
int maxAge,
boolean isSecure,
boolean isHttpOnly) |
static boolean |
containsCTL(String value,
int version) |
static String |
getCookieHeaderName(int version)
Return the header name to set the cookie, based on cookie version.
|
static boolean |
isToken(String value) |
static boolean |
isToken(String value,
String literals) |
static boolean |
isToken2(String value) |
static boolean |
isToken2(String value,
String literals) |
static int |
maybeQuote2(int version,
StringBuilder buf,
String value)
Quotes values using rules that vary depending on Cookie version.
|
static int |
maybeQuote2(int version,
StringBuilder buf,
String value,
boolean allowVersionSwitch) |
static int |
maybeQuote2(int version,
StringBuilder buf,
String value,
String literals,
boolean allowVersionSwitch) |
public static final boolean STRICT_SERVLET_COMPLIANCE
public static final boolean ALWAYS_ADD_EXPIRES
public static boolean isToken(String value)
public static boolean containsCTL(String value, int version)
public static boolean isToken2(String value)
public static String getCookieHeaderName(int version)
public static void appendCookieValue(StringBuilder buf, int version, String name, String value, String path, String domain, String comment, int maxAge, boolean isSecure, boolean isHttpOnly)
public static boolean alreadyQuoted(String value)
public static int maybeQuote2(int version, StringBuilder buf, String value)
version
- buf
- value
- public static int maybeQuote2(int version, StringBuilder buf, String value, boolean allowVersionSwitch)
public static int maybeQuote2(int version, StringBuilder buf, String value, String literals, boolean allowVersionSwitch)
Copyright © 2006–2018 TinyGroup. All rights reserved.