HATS 7.5.1 Web API Reference

Publicly accessible methods not documented here are for IBM internal use only and may change in a future release of the product.

com.ibm.hats.web.runtime
Class WebRequest

java.lang.Object
  extended by com.ibm.hats.web.runtime.WebRequest
All Implemented Interfaces:
IRequest

public class WebRequest
extends Object
implements IRequest

Class Name: WebRequest
Class Type:
Normal
Base Class:
None
Intf Class:
IRequest
Description:
Provides a wrapper for the HttpServletRequest class.


Constructor Summary
WebRequest(javax.servlet.http.HttpServletRequest theHttpServletRequest)
          The parameter constructor.
 
Method Summary
 boolean equals(Object webRequest)
          Compares object references for equality.
 String getApplicationId()
          Retrieve the application ID.
 Object getAttribute(String key)
          Retrieve the specified attribute.
 String getCharacterEncoding()
          Return the character encoding.
 String getContextPath()
          Retrieve the context path.
 String getHeader(String key)
          Retrieve the specified header.
 Enumeration getHeaderNames()
          Retrieve an Enumeration of the header names.
 javax.servlet.http.HttpServletRequest getHttpServletRequest()
          Retrieve the underlying HttpServletRequest.
 Locale getLocale()
          Retrieve the Locale.
 String getParameter(String key)
          Retrieve the specified parameter.
 Map getParameterMap()
          Retrieve the parameter Map.
 Enumeration getParameterNames()
          Retrieve an Enumeration of the parameter names.
 String[] getParameterValues(String key)
          Retrieve the specified array containing parameter values.
 String getPathInfo()
          Retrieve the path information.
 String getQueryString()
          Retrieve the query string.
 String getRemoteAddr()
          Retrieve the remote address.
 String getRemoteHost()
          Retrieve the remote host.
 IRequestDispatcher getRequestDispatcher(String key)
          Retrieve the specified request dispatcher.
 String getRequestedSessionId()
          Retrieve the requested session ID.
 String getRequestURI()
          Retrieve the request URI.
 StringBuffer getRequestURL()
          Retriee the request URL.
 String getServletPath()
          Retrieve the servlet path.
 ISession getSession()
          Retrieve the session.
 ISession getSession(boolean create)
          Returns the current session associated with this request or, if if there is no current session and create is true, returns a new session.
 ISessionService getSessionService()
          This method is not implemented and will throw a runtime UnsupportedOperationException if invoked.
 String getViewId()
          Returns unique ID that identifies the view into the application.
 int hashCode()
          Retrieve the hash code.
 void setAttribute(String key, Object attribute)
          Set the attribute for the key.
 void setHttpServletRequest(javax.servlet.http.HttpServletRequest theHttpServletRequest)
          Set a new HttpServletRequest.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebRequest

public WebRequest(javax.servlet.http.HttpServletRequest theHttpServletRequest)
The parameter constructor.

Parameters:
theHttpServletRequest - The servlet request that is being wrapped.
Method Detail

equals

public boolean equals(Object webRequest)
Compares object references for equality.

Overrides:
equals in class Object
Parameters:
webRequest - The web request.
Returns:
True if object references are equal, false otherwise.
See Also:
Object.equals(java.lang.Object)

getApplicationId

public String getApplicationId()
Retrieve the application ID.

Specified by:
getApplicationId in interface IRequest
Returns:
The application ID.
See Also:
IRequest.getApplicationId()

getAttribute

public Object getAttribute(String key)
Retrieve the specified attribute.

Specified by:
getAttribute in interface IRequest
Parameters:
key - The key of the attribute being retrieved.
Returns:
The attribute.
See Also:
ServletRequest.getAttribute(java.lang.String)

getCharacterEncoding

public String getCharacterEncoding()
Return the character encoding.

Specified by:
getCharacterEncoding in interface IRequest
Returns:
The character encoding.
See Also:
ServletRequest.getCharacterEncoding()

getContextPath

public String getContextPath()
Retrieve the context path.

Specified by:
getContextPath in interface IRequest
Returns:
The context path.
See Also:
HttpServletRequest.getContextPath()

getHeader

public String getHeader(String key)
Retrieve the specified header.

Specified by:
getHeader in interface IRequest
Parameters:
key - The header key.
Returns:
The specified header.
See Also:
HttpServletRequest.getHeader(java.lang.String)

getHeaderNames

public Enumeration getHeaderNames()
Retrieve an Enumeration of the header names.

Specified by:
getHeaderNames in interface IRequest
Returns:
An Enumeration of the header names.
See Also:
HttpServletRequest.getHeaderNames()

getHttpServletRequest

public javax.servlet.http.HttpServletRequest getHttpServletRequest()
Retrieve the underlying HttpServletRequest.

Returns:
Returns the underlying HttpServletRequest.

getLocale

public Locale getLocale()
Retrieve the Locale.

Specified by:
getLocale in interface IRequest
Returns:
The Locale.
See Also:
ServletRequest.getLocale()

getParameter

public String getParameter(String key)
Retrieve the specified parameter.

Specified by:
getParameter in interface IRequest
Parameters:
key - The key for the parameter being retrieved.
Returns:
The specified parameter.
See Also:
ServletRequest.getParameter(java.lang.String)

getParameterMap

public Map getParameterMap()
Retrieve the parameter Map.

Specified by:
getParameterMap in interface IRequest
Returns:
The parameter Map.
See Also:
ServletRequest.getParameterMap()

getParameterNames

public Enumeration getParameterNames()
Retrieve an Enumeration of the parameter names.

Specified by:
getParameterNames in interface IRequest
Returns:
An Enumeration of the parameter names.
See Also:
ServletRequest.getParameterNames()

getParameterValues

public String[] getParameterValues(String key)
Retrieve the specified array containing parameter values.

Specified by:
getParameterValues in interface IRequest
Parameters:
key - The key for the array being retrieved.
Returns:
The specified array containing parameter values.
See Also:
ServletRequest.getParameterValues(java.lang.String)

getPathInfo

public String getPathInfo()
Retrieve the path information.

Specified by:
getPathInfo in interface IRequest
Returns:
The path information.
See Also:
HttpServletRequest.getPathInfo()

getQueryString

public String getQueryString()
Retrieve the query string.

Specified by:
getQueryString in interface IRequest
Returns:
The query string.
See Also:
HttpServletRequest.getQueryString()

getRemoteAddr

public String getRemoteAddr()
Retrieve the remote address.

Specified by:
getRemoteAddr in interface IRequest
Returns:
The remote address.
See Also:
ServletRequest.getRemoteAddr()

getRemoteHost

public String getRemoteHost()
Retrieve the remote host.

Returns:
The remote host.
See Also:
ServletRequest.getRemoteHost()

getRequestDispatcher

public IRequestDispatcher getRequestDispatcher(String key)
Retrieve the specified request dispatcher.

Specified by:
getRequestDispatcher in interface IRequest
Parameters:
key - The key for the requested dispatcher.
Returns:
The key for the dispatcher being retrieved.
See Also:
ServletRequest.getRequestDispatcher(java.lang.String)

getRequestedSessionId

public String getRequestedSessionId()
Retrieve the requested session ID.

Specified by:
getRequestedSessionId in interface IRequest
Returns:
The requested session ID.
See Also:
HttpServletRequest.getRequestedSessionId()

getRequestURI

public String getRequestURI()
Retrieve the request URI.

Specified by:
getRequestURI in interface IRequest
Returns:
The request URI.
See Also:
HttpServletRequest.getRequestURI()

getRequestURL

public StringBuffer getRequestURL()
Retriee the request URL.

Specified by:
getRequestURL in interface IRequest
Returns:
The request URL.
See Also:
HttpServletRequest.getRequestURL()

getServletPath

public String getServletPath()
Retrieve the servlet path.

Specified by:
getServletPath in interface IRequest
Returns:
The servlet path.
See Also:
HttpServletRequest.getServletPath()

getSession

public ISession getSession()
Retrieve the session.

Specified by:
getSession in interface IRequest
Returns:
The session.
See Also:
HttpServletRequest.getSession()

getSession

public ISession getSession(boolean create)
Returns the current session associated with this request or, if if there is no current session and create is true, returns a new session. If create is false and the request has no valid session, this method returns null.

Specified by:
getSession in interface IRequest
Parameters:
create - (true)to create a new session for this request if necessary; (false)to return null if there's no current session
Returns:
the session associated with this request or null if create is false and the request has no valid session
See Also:
HttpServletRequest.getSession(boolean)

getSessionService

public ISessionService getSessionService()
This method is not implemented and will throw a runtime UnsupportedOperationException if invoked.

Specified by:
getSessionService in interface IRequest
Returns:
Nothing. This method is not implemented and will throw a runtime UnsupportedOperationException if invoked.

getViewId

public String getViewId()
Returns unique ID that identifies the view into the application.

Specified by:
getViewId in interface IRequest
Returns:
The view ID. In the case of a WebRequest, the view ID isn't used and returns an empty String.
See Also:
IRequest.getViewId()

hashCode

public int hashCode()
Retrieve the hash code.

Overrides:
hashCode in class Object
Returns:
The hash code. * @see java.lang.Object#hashCode()

setAttribute

public void setAttribute(String key,
                         Object attribute)
Set the attribute for the key.

Specified by:
setAttribute in interface IRequest
Parameters:
attribute - The attribute to be set.
key - The key used to save the attribute.
See Also:
ServletRequest.setAttribute(java.lang.String, java.lang.Object)

setHttpServletRequest

public void setHttpServletRequest(javax.servlet.http.HttpServletRequest theHttpServletRequest)
Set a new HttpServletRequest.

Parameters:
theHttpServletRequest - The new HttpServletRequest to set.

HATS 7.5.1 (201005110649)