Expresso 5-6

com.jcorporate.expresso.core.jsdkapi
Interface APIAwareSession

All Known Implementing Classes:
ServletAPI2_1Session, ServletAPI2_2Session

public interface APIAwareSession

APIAwareSession defines a wrapper for a session object that can store & retrieve serializable objects into the session, using the calls appropriate to the selected Servlet API


Method Summary
 Serializable getAttribute(HttpServletRequest req, String code)
          Get an attribute from the session
 Enumeration getAttributeNames(HttpServletRequest req)
          Get all the attribute names from the request
 String getContextPath(HttpServletRequest req)
          Retrieve the context path
 String getId(HttpServletRequest req)
          Get the session id
 void invalidate(HttpServletRequest req)
          Invalidate teh session
 void removeAttribute(HttpServletRequest req, String code)
          Remove an attribute from the session
 void setAttribute(HttpServletRequest req, String code, Serializable value)
          Set an attribute in the session
 

Method Detail

getAttribute

public Serializable getAttribute(HttpServletRequest req,
                                 String code)
                          throws ServletException
Get an attribute from the session

Parameters:
req - The HttpServletRequest object
code - the attribute code
Returns:
Serializable object as stored in the session
Throws:
ServletException

getAttributeNames

public Enumeration getAttributeNames(HttpServletRequest req)
                              throws ServletException
Get all the attribute names from the request

Parameters:
req - The servlet request object
Returns:
java.util.Enumeration
Throws:
ServletException - upon error

setAttribute

public void setAttribute(HttpServletRequest req,
                         String code,
                         Serializable value)
                  throws ServletException
Set an attribute in the session

Parameters:
req - The servlet request
code - The attribute "Key"
value - the value of the object
Throws:
ServletException

removeAttribute

public void removeAttribute(HttpServletRequest req,
                            String code)
                     throws ServletException
Remove an attribute from the session

Parameters:
req - The servlet request object
code - the key to remove
Throws:
ServletException - upon error

invalidate

public void invalidate(HttpServletRequest req)
Invalidate teh session

Parameters:
req - the servlet request

getContextPath

public String getContextPath(HttpServletRequest req)
Retrieve the context path

Parameters:
req - the http servlet request
Returns:
the context path: java.lang.String

getId

public String getId(HttpServletRequest req)
Get the session id

Parameters:
req - the httpservlet request
Returns:
the session id string

Expresso 5-6

Please see www.jcorporate.com for information about new Expresso releases.