public class CookieContext extends Object implements Context, Map<String,Object>
| Constructor and Description |
|---|
CookieContext(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
Creates a new CookieContext for this request and response.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
Set<Map.Entry<String,Object>> |
entrySet() |
Object |
get(Object key) |
Object |
getAttribute(String name)
Return the cookie value with the given name, if present.
|
boolean |
hasAttribute(String name)
Returns true is an attribute exists with this name.
|
boolean |
isEmpty() |
Iterator<String> |
keys()
Return an iterator with all the attribute names in this context.
|
Set<String> |
keySet() |
String |
put(String key,
Object value) |
void |
putAll(Map<? extends String,? extends Object> t) |
String |
remove(Object key) |
void |
removeAttribute(String name)
Tell the browser to remove the given cookie.
|
void |
reset()
Resets this context.
|
void |
setAttribute(String name,
Object value)
Sets a cookie to send to the client in the response.
|
int |
size() |
Collection<Object> |
values() |
public CookieContext(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
req - The request from where to get the cookies.res - The response where to put the new cookies.public Object getAttribute(String name)
getAttribute in interface Contextname - The name of the cookie to returnpublic Iterator<String> keys()
Contextpublic void setAttribute(String name, Object value)
setAttribute in interface Contextname - The name of this cookievalue - The cookie object or the value of the cookie as a Stringpublic void removeAttribute(String name)
removeAttribute in interface Contextname - The name of the cookie to remove.public void reset()
Contextpublic boolean hasAttribute(String name)
ContexthasAttribute in interface Contextname - The name of the attribute.public boolean containsKey(Object key)
containsKey in interface Map<String,Object>public boolean containsValue(Object value)
containsValue in interface Map<String,Object>Copyright © 2015. All Rights Reserved.