public final class CookieImpl extends ScopeSupport implements Cookie, ScriptProtected
Collection.Key
Modifier and Type | Field and Description |
---|---|
static int |
NEVER |
TYPE_UNDEFINED
SCOPE_APPLICATION, SCOPE_ARGUMENTS, SCOPE_CALLER, SCOPE_CGI, SCOPE_CLIENT, SCOPE_CLUSTER, SCOPE_COOKIE, SCOPE_COUNT, SCOPE_FORM, SCOPE_LOCAL, SCOPE_REQUEST, SCOPE_SERVER, SCOPE_SESSION, SCOPE_UNDEFINED, SCOPE_URL, SCOPE_VAR, SCOPE_VARIABLES
TYPE_LINKED, TYPE_REGULAR, TYPE_SOFT, TYPE_SYNC, TYPE_WEAKED
NO, UNDEFINED, YES
Constructor and Description |
---|
CookieImpl()
constructor for the Cookie Scope
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
clears the collection
|
String |
dec(String str) |
String |
enc(String str) |
void |
initialize(PageContext pc)
Initalize Scope
|
static boolean |
isHTTPOnly(javax.servlet.http.Cookie cookie) |
boolean |
isScriptProtected() |
void |
release()
release scope for reuse
|
void |
release(PageContext pc)
release scope for reuse
|
Object |
remove(Collection.Key key)
removes value from collection and return it when it exists, otherwise throws a exception
|
Object |
remove(Collection.Key key,
boolean alsoInResponse) |
Object |
removeEL(Collection.Key key)
removes value from collection and return it when it exists, otherwise returns null
|
void |
resetEnv(PageContext pc) |
Object |
set(Collection.Key key,
Object value)
sets a value to the collection
|
void |
setCookie(Collection.Key key,
Object value,
int expires,
boolean secure,
String path,
String domain)
set a cookie value
|
void |
setCookie(Collection.Key key,
Object value,
int expires,
boolean secure,
String path,
String domain,
boolean httpOnly,
boolean preserveCase,
boolean encode)
set a cookie value
|
void |
setCookie(Collection.Key key,
Object value,
Object expires,
boolean secure,
String path,
String domain)
set a cookie value
|
void |
setCookie(Collection.Key key,
Object value,
Object expires,
boolean secure,
String path,
String domain,
boolean httpOnly,
boolean preserveCase,
boolean encode)
set a cookie value
|
void |
setCookieEL(Collection.Key key,
Object value,
int expires,
boolean secure,
String path,
String domain)
set a cookie value
|
void |
setCookieEL(Collection.Key key,
Object value,
int expires,
boolean secure,
String path,
String domain,
boolean httpOnly,
boolean preserveCase,
boolean encode)
set a cookie value
|
Object |
setEL(Collection.Key key,
Object value)
sets a value to the collection, if key doesn't exist, dont throw a exception, returns null
|
static void |
setHTTPOnly(javax.servlet.http.Cookie cookie) |
void |
setScriptProtecting(ApplicationContext ac,
boolean scriptProtected)
transform the string values of the scope do a script protecting way
|
void |
touchAfterRequest(PageContext pc)
release scope only for current request, scope will be used again
|
void |
touchBeforeRequest(PageContext pc)
Initalize Scope only for this request, scope was already used
|
_getId, getType, getTypeAsString, isInitalized, sizeOf, toDumpData, toDumpData
containsKey, containsValue, copy, duplicate, entryIterator, equals, g, g, get, get, hashCode, keyIterator, keys, keysAsStringIterator, remove, size, valueIterator, values
call, callWithNamedValues, castToBoolean, castToBooleanValue, castToDateTime, castToDateTime, castToDoubleValue, castToDoubleValue, castToString, castToString, clone, compareTo, compareTo, compareTo, compareTo, containsKey, containsKey, entrySet, get, get, get, get, get, getIterator, invalidKey, isEmpty, keySet, put, putAll, remove, set, set, setEL, setEL, toString
getType, getTypeAsString, isInitalized
clone, containsKey, containsKey, duplicate, get, get, get, get, keys, set, setEL, size
entryIterator, keyIterator, keysAsStringIterator, valueIterator
getIterator
containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values
call, callWithNamedValues, get, get, set, setEL
toDumpData
castToBoolean, castToBooleanValue, castToDateTime, castToDateTime, castToDoubleValue, castToDoubleValue, castToString, castToString, compareTo, compareTo, compareTo, compareTo
public static final int NEVER
public CookieImpl()
public Object setEL(Collection.Key key, Object value)
Collection
setEL
in interface Collection
setEL
in class StructImpl
key
- key of the value to getvalue
- value to setpublic Object set(Collection.Key key, Object value) throws PageException
Collection
set
in interface Collection
set
in class StructImpl
key
- key of the new valuevalue
- value to setPageException
public void clear()
Collection
clear
in interface Map
clear
in interface Collection
clear
in class StructImpl
public Object remove(Collection.Key key) throws PageException
Collection
remove
in interface Collection
remove
in class StructImpl
key
- key of the collectionPageException
public Object remove(Collection.Key key, boolean alsoInResponse) throws PageException
PageException
public Object removeEL(Collection.Key key)
Collection
removeEL
in interface Collection
removeEL
in class StructImpl
key
- key of the collectionpublic void setCookie(Collection.Key key, Object value, Object expires, boolean secure, String path, String domain) throws PageException
Cookie
setCookie
in interface Cookie
key
- name of the cookievalue
- value of the cookieexpires
- expirs of the cookie (Date, number in seconds or keyword as string )secure
- set secure or notpath
- path of the cookiedomain
- domain of the cookiePageException
public void setCookie(Collection.Key key, Object value, int expires, boolean secure, String path, String domain) throws PageException
Cookie
setCookie
in interface Cookie
key
- Name of the cookievalue
- value of the cookieexpires
- expires in secondssecure
- secute or notpath
- path of the cookiedomain
- domain of the cookiePageException
public void setCookieEL(Collection.Key key, Object value, int expires, boolean secure, String path, String domain)
Cookie
setCookieEL
in interface Cookie
key
- Name of the cookievalue
- value of the cookieexpires
- expires in secondssecure
- secute or notpath
- path of the cookiedomain
- domain of the cookiepublic void setCookie(Collection.Key key, Object value, Object expires, boolean secure, String path, String domain, boolean httpOnly, boolean preserveCase, boolean encode) throws PageException
Cookie
setCookie
in interface Cookie
key
- name of the cookievalue
- value of the cookieexpires
- expirs of the cookie (Date, number in seconds or keyword as string )secure
- set secure or notpath
- path of the cookiedomain
- domain of the cookiehttpOnly
- if true, sets cookie as httponly so that it cannot be accessed using JavaScripts. Note that the browser must have httponly compatibility.preserveCase
- if true, keep the case of the name as it isencode
- if true, url encode the name and the valuePageException
public void setCookie(Collection.Key key, Object value, int expires, boolean secure, String path, String domain, boolean httpOnly, boolean preserveCase, boolean encode) throws PageException
Cookie
setCookie
in interface Cookie
key
- Name of the cookievalue
- value of the cookieexpires
- expires in secondssecure
- secute or notpath
- path of the cookiedomain
- domain of the cookiehttpOnly
- if true, sets cookie as httponly so that it cannot be accessed using JavaScripts. Note that the browser must have httponly compatibility.preserveCase
- if true, keep the case of the name as it isencode
- if true, url encode the name and the valuePageException
public void setCookieEL(Collection.Key key, Object value, int expires, boolean secure, String path, String domain, boolean httpOnly, boolean preserveCase, boolean encode)
Cookie
setCookieEL
in interface Cookie
key
- Name of the cookievalue
- value of the cookieexpires
- expires in secondssecure
- secute or notpath
- path of the cookiedomain
- domain of the cookiehttpOnly
- if true, sets cookie as httponly so that it cannot be accessed using JavaScripts. Note that the browser must have httponly compatibility.preserveCase
- if true, keep the case of the name as it isencode
- if true, url encode the name and the valuepublic void initialize(PageContext pc)
Scope
initialize
in interface Scope
initialize
in class ScopeSupport
pc
- Page Contextpublic void release()
Scope
release
in interface Scope
release
in class ScopeSupport
public void release(PageContext pc)
Scope
release
in interface Scope
release
in class ScopeSupport
public boolean isScriptProtected()
isScriptProtected
in interface ScriptProtected
public void setScriptProtecting(ApplicationContext ac, boolean scriptProtected)
ScriptProtected
setScriptProtecting
in interface ScriptProtected
public void resetEnv(PageContext pc)
public void touchBeforeRequest(PageContext pc)
SharedScope
touchBeforeRequest
in interface SharedScope
pc
- Page Contextpublic void touchAfterRequest(PageContext pc)
SharedScope
touchAfterRequest
in interface SharedScope
public static void setHTTPOnly(javax.servlet.http.Cookie cookie)
public static boolean isHTTPOnly(javax.servlet.http.Cookie cookie)
Copyright © 2015 Lucee