com.javaranch.common
Class ServletData

java.lang.Object
  |
  +--com.javaranch.common.ServletData

public class ServletData
extends java.lang.Object


Constructor Summary
ServletData(HttpServletRequest request, HttpServletResponse response)
           
ServletData(HttpServletRequest request, HttpServletResponse response, HttpSession session)
           
 
Method Summary
 boolean exists(java.lang.String key)
          Is the key used in the session.
 java.lang.Object get(java.lang.String key)
          Get an object from the session.
 int getInt(java.lang.String key)
          The complementary method to "set(key,int)".
 java.lang.String getParameter(java.lang.String parameterName)
          Same as getRequest.getParameter().
 java.lang.String[] getParameterValues(java.lang.String parameterName)
          Same as getRequest.getParameterValues().
 HttpServletRequest getRequest()
          Get the j2ee request.
 HttpServletResponse getResponse()
          Get the j2ee response.
 HttpSession getSession()
          Get the j2ee session.
 java.lang.String getString(java.lang.String key)
          Same as get(), only with a "toString()" performed on the returned object.
 void remove(java.lang.String key)
          Remove an object from the session.
 void set(java.lang.String key, int i)
          Store an integer in the session.
 void set(java.lang.String key, java.lang.Object obj)
          Store an object in the session.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServletData

public ServletData(HttpServletRequest request,
                   HttpServletResponse response,
                   HttpSession session)

ServletData

public ServletData(HttpServletRequest request,
                   HttpServletResponse response)
Method Detail

set

public void set(java.lang.String key,
                java.lang.Object obj)
Store an object in the session.


get

public java.lang.Object get(java.lang.String key)
Get an object from the session. If the session does not exist or if the key does not exist, null is returned.


getString

public java.lang.String getString(java.lang.String key)
Same as get(), only with a "toString()" performed on the returned object.


set

public void set(java.lang.String key,
                int i)
Store an integer in the session.


getInt

public int getInt(java.lang.String key)
The complementary method to "set(key,int)".


exists

public boolean exists(java.lang.String key)
Is the key used in the session.


remove

public void remove(java.lang.String key)
Remove an object from the session.


getSession

public HttpSession getSession()
Get the j2ee session.


getRequest

public HttpServletRequest getRequest()
Get the j2ee request.


getResponse

public HttpServletResponse getResponse()
Get the j2ee response.


getParameter

public java.lang.String getParameter(java.lang.String parameterName)
Same as getRequest.getParameter().


getParameterValues

public java.lang.String[] getParameterValues(java.lang.String parameterName)
Same as getRequest.getParameterValues().



Copyright ©2004 Paul Wheaton All Rights Reserved