|
Expresso 5-6 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.jcorporate.expresso.core.controller.session.HTTPPersistentSession
A HTTPPersistentSession is simply a place to stash some values
between states of a controller object. Different environments may employ
different ways of doing this - the simplest being this one, where a
hashtable does all the required work.
HTTPPersistentSession, which
stores it's values in the HTTPSession for storage from one invokation to
the next.
If you are inside a controller environment, then call ControllerRequest.getSession()
to get a PersistentSession object, and do not install this class
directly. See the PersistentSession javadoc documentation for an example
usage of this class
PersistentSession,
Serialized Form| Constructor Summary | |
HTTPPersistentSession()
Creates new HTTPPersistentSession |
|
HTTPPersistentSession(HttpServletRequest req,
HttpServletResponse res)
Creates new HTTPPersistentSession and set the request object in one step |
|
| Method Summary | |
Object |
getAttribute(String attribName)
Retrieves the object from the request context. |
Enumeration |
getAttributeNames()
Retrieves all attribute names in the request context. |
String |
getClientAttribute(String attribName)
Retrieves a value of a cookie set on the client's system. |
Enumeration |
getPeristentAttributeNames()
Retrieves all attribute names from the session context. |
Object |
getPersistentAttribute(String attribName)
Retrieves the object from the session context. |
void |
invalidate()
Clear out the session. |
void |
removeAttribute(String attribName)
Clears an attribute from the request context |
void |
removePersistentAttribute(String attribName)
Clears an attribute from the session context |
void |
setAttribute(String attribName,
Object attribValue)
Sets an attribute on the Servlet request |
void |
setClientAttribute(String attribName,
String attribValue)
Sets a cookie in the client's system. |
void |
setPersistentAttribute(String attribName,
Object attribValue)
Saves an attribute to the actual session, rather than simply the response. |
void |
setRequest(HttpServletRequest req)
Set the request object so we can get to the session. |
void |
setResponse(HttpServletResponse res)
Set the response object so we can get to all the http objects we need. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public HTTPPersistentSession()
public HTTPPersistentSession(HttpServletRequest req,
HttpServletResponse res)
req - a HttpServletRequest objectres - a HttpServletResponse object| Method Detail |
public void setAttribute(String attribName,
Object attribValue)
setAttribute in interface PersistentSessionattribName - The name of the object you wish to set.attribValue - the object you want to set.
IllegalArgumentException - if the current object's Request object
has not be set yet.public Object getAttribute(String attribName)
getAttribute in interface PersistentSessionattribName - the name of the object to retrieve
public Enumeration getAttributeNames()
getAttributeNames in interface PersistentSession
public void setClientAttribute(String attribName,
String attribValue)
expresso-config.xml file.
setClientAttribute in interface PersistentSessionattribName - the name of the attribute toattribValue - the value of the attribute to set.
IllegalArgumentException - If the cookie encryption fails for
some reason. The actual chained exception is logged.public String getClientAttribute(String attribName)
expresso-config.xml file.
getClientAttribute in interface PersistentSessionattribName - the name of the cookie to retrieve
IllegalArgumentException - If there's a problem decrypting the
cookie. The full error is logged. [Especially important for chained
exceptions]public Enumeration getPeristentAttributeNames()
getPeristentAttributeNames in interface PersistentSession
public void setPersistentAttribute(String attribName,
Object attribValue)
setPersistentAttribute in interface PersistentSessionattribName - the name of the attribute to setattribValue - a Serializable java object.
IllegalArgumentException - If there is an error storing the cookie
to the session.Serializablepublic Object getPersistentAttribute(String attribName)
getPersistentAttribute in interface PersistentSessionattribName - the name of the object to retrieve
public void setRequest(HttpServletRequest req)
req - An HttpServletRequest object.public void setResponse(HttpServletResponse res)
res - A HttpServletResponse objectpublic void invalidate()
invalidate in interface PersistentSessionpublic void removeAttribute(String attribName)
removeAttribute in interface PersistentSessionattribName - the name of the attribute to remove.public void removePersistentAttribute(String attribName)
removePersistentAttribute in interface PersistentSessionattribName - the name of the attribute to remove.
|
Expresso 5-6 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||