|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mentawai.core.CookieContext
public class CookieContext
A cookie management abstraction into a Mentawai context. Note that this class is smart enough to keep track of which cookies were added, which ones were removed and which ones did not suffer any modification and should not be sent again to the browser.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface java.util.Map |
|---|
Map.Entry<K,V> |
| Constructor Summary | |
|---|---|
CookieContext(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
Creates a new CookieContext for this request and response. |
|
| Method Summary | |
|---|---|
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()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface java.util.Map |
|---|
equals, hashCode |
| Constructor Detail |
|---|
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.| Method Detail |
|---|
public Object getAttribute(String name)
getAttribute in interface Contextname - The name of the cookie to return
public Iterator<String> keys()
Context
keys in interface Context
public 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()
Context
reset in interface Contextpublic boolean hasAttribute(String name)
Context
hasAttribute in interface Contextname - The name of the attribute.
public void clear()
clear in interface Map<String,Object>public boolean containsKey(Object key)
containsKey in interface Map<String,Object>public boolean containsValue(Object value)
containsValue in interface Map<String,Object>public Set<Map.Entry<String,Object>> entrySet()
entrySet in interface Map<String,Object>public Object get(Object key)
get in interface Map<String,Object>public boolean isEmpty()
isEmpty in interface Map<String,Object>public Set<String> keySet()
keySet in interface Map<String,Object>
public String put(String key,
Object value)
put in interface Map<String,Object>public void putAll(Map<? extends String,? extends Object> t)
putAll in interface Map<String,Object>public String remove(Object key)
remove in interface Map<String,Object>public int size()
size in interface Map<String,Object>public Collection<Object> values()
values in interface Map<String,Object>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||