|
JSecurity | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jsecurity.web.attr.AbstractWebAttribute<T>
org.jsecurity.web.attr.CookieAttribute<T>
public class CookieAttribute<T>
A CookieAttribute stores an object as a Cookie for access on later requests.
| Field Summary | |
|---|---|
static int |
DEFAULT_MAX_AGE
-1, indicating the cookie should expire when the browser closes. |
static String |
DEFAULT_PATH
null, indicating the cookie should be set on the request context root. |
static boolean |
DEFAULT_SECURE
Default value is false. |
static int |
INDEFINITE
This is the same value as Integer.MAX_VALUE, and while Tomcat does fine with cookie max age with this value, Jetty apparently has problems with it. |
static int |
ONE_YEAR
The number of seconds in one year (= 60 * 60 * 24 * 365). |
| Fields inherited from class org.jsecurity.web.attr.AbstractWebAttribute |
|---|
checkRequestParams, checkRequestParamsFirst, DEFAULT_NAME, mutable, name |
| Constructor Summary | |
|---|---|
CookieAttribute()
|
|
CookieAttribute(String name)
Constructs a CookieAttribute using a Cookie with the specified name
using the request context's path and with a maxAge of -1, indicating the
Cookie will persist until browser shutdown. |
|
CookieAttribute(String name,
int maxAge)
Constructs a CookieAttribute using a Cookie with the specified
name and maxAge. |
|
CookieAttribute(String name,
String path)
Constructs a CookieAttribute using a Cookie with the specified
name and path. |
|
CookieAttribute(String name,
String path,
int maxAge)
Constructs a CookieAttribute using a Cookie with the specified
name, path, and
maxAge. |
|
CookieAttribute(String name,
String path,
int maxAge,
Class<? extends PropertyEditor> editorClass)
Constructs a CookieAttribute using a Cookie with the specified
name, path, and
maxAge, utilizing the specified PropertyEditor to perform value/string
conversion on the object stored as a cookie. |
|
| Method Summary | |
|---|---|
int |
getMaxAge()
Returns the Cookie's maxAge setting. |
String |
getPath()
Returns the Cookie's path setting. |
boolean |
isSecure()
|
T |
onRetrieveValue(ServletRequest request,
ServletResponse response)
|
void |
onStoreValue(T value,
ServletRequest servletRequest,
ServletResponse servletResponse)
|
void |
removeValue(ServletRequest servletRequest,
ServletResponse response)
|
void |
setMaxAge(int maxAge)
Sets the Cookie's maxAge setting. |
void |
setPath(String path)
Sets the Cookie's path setting. |
void |
setSecure(boolean secure)
|
| Methods inherited from class org.jsecurity.web.attr.AbstractWebAttribute |
|---|
fromStringValue, getEditorClass, getFromRequestParam, getName, isCheckRequestParams, isCheckRequestParamsFirst, isMutable, retrieveValue, setCheckRequestParams, setCheckRequestParamsFirst, setEditorClass, setMutable, setName, storeValue, toStringValue |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int ONE_YEAR
public static final int INDEFINITE
ONE_YEAR constant or another value.
public static final String DEFAULT_PATH
null, indicating the cookie should be set on the request context root.
public static final int DEFAULT_MAX_AGE
-1, indicating the cookie should expire when the browser closes.
public static final boolean DEFAULT_SECURE
false.
| Constructor Detail |
|---|
public CookieAttribute()
public CookieAttribute(String name)
Cookie with the specified name
using the request context's path and with a maxAge of -1, indicating the
Cookie will persist until browser shutdown.
name - the Cookie name
public CookieAttribute(String name,
String path)
Cookie with the specified
name and path.
A null path value means the request context's path will be used by default.
The Cookie's maxAge will be -1, indicating the Cookie will persist until
browser shutdown.
name - the Cookie namepath - the Cookie path.
public CookieAttribute(String name,
int maxAge)
Cookie with the specified
name and maxAge.
The Cookie's path will be the Request's
context path.
name - the Cookie name;maxAge - the Cookie maxAge
public CookieAttribute(String name,
String path,
int maxAge)
Cookie with the specified
name, path, and
maxAge.
name - the Cookie namepath - the Cookie path.maxAge - the Cookie maxAge
public CookieAttribute(String name,
String path,
int maxAge,
Class<? extends PropertyEditor> editorClass)
Cookie with the specified
name, path, and
maxAge, utilizing the specified PropertyEditor to perform value/string
conversion on the object stored as a cookie.
name - the Cookie namepath - the Cookie path.maxAge - the Cookie maxAgeeditorClass - the PropertyEditor to perform value/string conversion on the object stored as a
Cookie.| Method Detail |
|---|
public String getPath()
path setting. If null, the request's
context path will be used.
The default is null.
public void setPath(String path)
path setting. If the argument is null, the request's
context path will be used.
The default is null.
path - the Cookie's path, or null if the request's context path should be used as the path when the
cookie is created.public int getMaxAge()
maxAge setting. Please see that JavaDoc for the semantics on
the repercussions of negative, zero, and positive values for the maxAge.
The default value is -1, meaning the cookie will expire when the browser is closed.
maxAgepublic void setMaxAge(int maxAge)
maxAge setting. Please see that JavaDoc for the semantics on
the repercussions of negative, zero, and positive values for the maxAge.
The default value is -1, meaning the cookie will expire when the browser is closed.
maxAge - the Cookie's maxAgepublic boolean isSecure()
public void setSecure(boolean secure)
public T onRetrieveValue(ServletRequest request,
ServletResponse response)
onRetrieveValue in class AbstractWebAttribute<T>
public void onStoreValue(T value,
ServletRequest servletRequest,
ServletResponse servletResponse)
onStoreValue in class AbstractWebAttribute<T>
public void removeValue(ServletRequest servletRequest,
ServletResponse response)
|
JSecurity | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||