org.apache.cactus.server
Class HttpServletRequestWrapper

java.lang.Object
  |
  +--org.apache.cactus.server.AbstractHttpServletRequestWrapper
        |
        +--org.apache.cactus.server.HttpServletRequestWrapper
All Implemented Interfaces:
javax.servlet.http.HttpServletRequest, javax.servlet.ServletRequest

public class HttpServletRequestWrapper
extends AbstractHttpServletRequestWrapper

Encapsulation class for the Servlet 2.3 API HttpServletRequest. This is an implementation that delegates all the call to the HttpServletRequest object passed in the constructor except for some overiden methods which are use to simulate a URL. This is to be able to simulate any URL that would have been used to call the test method : if this was not done, the URL that would be returned (by calling the getRequestURI() method or others alike) would be the URL of the Cactus redirector servlet and not a URL that the test case want to simulate.

Version:
$Id: HttpServletRequestWrapper.java,v 1.9 2001/09/16 14:46:23 vmassol Exp $
Author:
Vincent Massol

Fields inherited from interface javax.servlet.http.HttpServletRequest
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH
 
Constructor Summary
HttpServletRequestWrapper(javax.servlet.http.HttpServletRequest theRequest, ServletURL theURL)
          Construct an HttpServletRequest instance that delegates it's method calls to the request object passed as parameter and that uses the URL passed as parameter to simulate a URL from which the request would come from.
 
Method Summary
 java.util.Map getParameterMap()
           
 java.lang.StringBuffer getRequestURL()
           
 void setCharacterEncoding(java.lang.String env)
           
 
Methods inherited from class org.apache.cactus.server.AbstractHttpServletRequestWrapper
getAttribute, getAttributeNames, getAuthType, getCharacterEncoding, getContentLength, getContentType, getContextPath, getCookies, getDateHeader, getHeader, getHeaderNames, getHeaders, getInputStream, getIntHeader, getLocale, getLocales, getMethod, getOriginalRequest, getParameter, getParameterNames, getParameterValues, getPathInfo, getPathTranslated, getProtocol, getQueryString, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemoteUser, getRequestDispatcher, getRequestedSessionId, getRequestURI, getScheme, getServerName, getServerPort, getServletPath, getSession, getSession, getUserPrincipal, isRequestedSessionIdFromCookie, isRequestedSessionIdFromUrl, isRequestedSessionIdFromURL, isRequestedSessionIdValid, isSecure, isUserInRole, removeAttribute, setAttribute
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpServletRequestWrapper

public HttpServletRequestWrapper(javax.servlet.http.HttpServletRequest theRequest,
                                 ServletURL theURL)
Construct an HttpServletRequest instance that delegates it's method calls to the request object passed as parameter and that uses the URL passed as parameter to simulate a URL from which the request would come from.
Parameters:
theRequest - the real HTTP request
theURL - the URL to simulate or null if none
Method Detail

getRequestURL

public java.lang.StringBuffer getRequestURL()

setCharacterEncoding

public void setCharacterEncoding(java.lang.String env)
                          throws java.io.UnsupportedEncodingException

getParameterMap

public java.util.Map getParameterMap()


Copyright © 2000-2001 Apache Software Foundation. All Rights Reserved.