Save This Page
Home » cactus-1.8.0-src » org.apache.cactus.server » [javadoc | source]
org.apache.cactus.server
abstract public class: AbstractHttpServletRequestWrapper [javadoc | source]
java.lang.Object
   org.apache.cactus.server.AbstractHttpServletRequestWrapper

All Implemented Interfaces:
    HttpServletRequest

Direct Known Subclasses:
    HttpServletRequestWrapper, AbstractHttpServletRequestWrapper23

Abstract wrapper around HttpServletRequest . This class provides a common implementation of the wrapper for the different Servlet APIs. This is an implementation that delegates all the call to the HttpServletRequest object passed in the constructor except for some overidden 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 HttpServletRequest#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.
Field Summary
protected  HttpServletRequest request    The real HTTP request. 
protected  ServletURL url    The URL to simulate. 
protected  String remoteIPAddress    Remote IP address to simulate (if any). 
protected  String remoteHostName    Remote Host name to simulate (if any). 
protected  String remoteUser    Remote user to simulate (if any). 
Constructor:
 public AbstractHttpServletRequestWrapper(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 from org.apache.cactus.server.AbstractHttpServletRequestWrapper Summary:
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,   getRequestURI,   getRequestedSessionId,   getScheme,   getServerName,   getServerPort,   getServletPath,   getSession,   getSession,   getUserPrincipal,   isRequestedSessionIdFromCookie,   isRequestedSessionIdFromURL,   isRequestedSessionIdFromUrl,   isRequestedSessionIdValid,   isSecure,   isUserInRole,   newInstance,   removeAttribute,   setAttribute,   setRemoteHostName,   setRemoteIPAddress,   setRemoteUser
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.cactus.server.AbstractHttpServletRequestWrapper Detail:
 public Object getAttribute(String theName) 
    {@inheritDoc}
 public Enumeration getAttributeNames() 
    {@inheritDoc}
 public String getAuthType() 
    {@inheritDoc}
 public String getCharacterEncoding() 
    {@inheritDoc}
 public int getContentLength() 
    {@inheritDoc}
 public String getContentType() 
    {@inheritDoc}
 public String getContextPath() 
 public Cookie[] getCookies() 
    {@inheritDoc}
 public long getDateHeader(String theName) 
    {@inheritDoc}
 public String getHeader(String theName) 
    {@inheritDoc}
 public Enumeration getHeaderNames() 
    {@inheritDoc}
 public Enumeration getHeaders(String theName) 
    {@inheritDoc}
 public ServletInputStream getInputStream() throws IOException 
    {@inheritDoc}
 public int getIntHeader(String theName) 
    {@inheritDoc}
 public Locale getLocale() 
    {@inheritDoc}
 public Enumeration getLocales() 
    {@inheritDoc}
 public String getMethod() 
    {@inheritDoc}
 public HttpServletRequest getOriginalRequest() 
 public String getParameter(String theName) 
    {@inheritDoc}
 public Enumeration getParameterNames() 
    {@inheritDoc}
 public String[] getParameterValues(String theName) 
    {@inheritDoc}
 public String getPathInfo() 
 public String getPathTranslated() 
 public String getProtocol() 
    {@inheritDoc}
 public String getQueryString() 
 public BufferedReader getReader() throws IOException 
    {@inheritDoc}
 public String getRealPath(String thePath) 
    {@inheritDoc}
 public String getRemoteAddr() 
 public String getRemoteHost() 
 public String getRemoteUser() 
 public RequestDispatcher getRequestDispatcher(String thePath) 
 public String getRequestURI() 
 public String getRequestedSessionId() 
    {@inheritDoc}
 public String getScheme() 
    {@inheritDoc}
 public String getServerName() 
 public int getServerPort() 
 public String getServletPath() 
 public HttpSession getSession() 
    {@inheritDoc}
 public HttpSession getSession(boolean isCreate) 
    {@inheritDoc}
 public Principal getUserPrincipal() 
    {@inheritDoc}
 public boolean isRequestedSessionIdFromCookie() 
    {@inheritDoc}
 public boolean isRequestedSessionIdFromURL() 
    {@inheritDoc}
 public boolean isRequestedSessionIdFromUrl() 
    {@inheritDoc}
 public boolean isRequestedSessionIdValid() 
    {@inheritDoc}
 public boolean isSecure() 
    {@inheritDoc}
 public boolean isUserInRole(String theRole) 
    {@inheritDoc}
 public static AbstractHttpServletRequestWrapper newInstance(HttpServletRequest theOriginalRequest,
    ServletURL theURL) 
    {@inheritDoc}
 public  void removeAttribute(String theName) 
    {@inheritDoc}
 public  void setAttribute(String theName,
    Object theAttribute) 
    {@inheritDoc}
 public  void setRemoteHostName(String theRemoteHostName) 
    Simulates the remote host name(ie the client host name).
 public  void setRemoteIPAddress(String theRemoteIPAddress) 
    Simulates the remote IP address (ie the client IP address).
 public  void setRemoteUser(String theRemoteUser) 
    Sets the remote user name to simulate.