|
|||||||||
| Home >> All >> servletunit >> [ struts overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
servletunit.struts
Class StrutsRequestWrapper

java.lang.Objectorg.apache.cactus.server.AbstractHttpServletRequestWrapper
org.apache.cactus.server.AbstractHttpServletRequestWrapper23
org.apache.cactus.server.HttpServletRequestWrapper
servletunit.struts.StrutsRequestWrapper
- All Implemented Interfaces:
- javax.servlet.http.HttpServletRequest, javax.servlet.ServletRequest
- public class StrutsRequestWrapper
- extends org.apache.cactus.server.HttpServletRequestWrapper
A wrapper for the HttpServletRequest class. This is used in CactusStrutsTestCase so that we can add our own request parameters outside of the beginXXX and endXXX methods. This allows us to to use the ActionServlet as a black box, rather than mimic its behavior as was previously the case.
| Field Summary | |
private java.util.Map |
parameters
|
private java.lang.String |
pathInfo
|
private java.lang.String |
servletPath
|
| Fields inherited from class org.apache.cactus.server.AbstractHttpServletRequestWrapper |
remoteHostName, remoteIPAddress, remoteUser, request, url |
| Fields inherited from interface javax.servlet.http.HttpServletRequest |
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH |
| Constructor Summary | |
StrutsRequestWrapper(org.apache.cactus.server.HttpServletRequestWrapper request)
|
|
| Method Summary | |
void |
addParameter(java.lang.String name,
java.lang.String value)
|
void |
addParameter(java.lang.String name,
java.lang.String[] values)
|
void |
clearRequestParameters()
|
java.lang.String |
getParameter(java.lang.String name)
Returns the value of a request parameter as a String,
or null if the parameter does not exist. |
java.util.Map |
getParameterMap()
Returns a java.util.Map of the parameters of this request. |
java.util.Enumeration |
getParameterNames()
Returns an Enumeration of String
objects containing the names of the parameters contained
in this request. |
java.lang.String[] |
getParameterValues(java.lang.String name)
Returns an array of String objects containing
all of the values the given request parameter has, or
null if the parameter does not exist. |
java.lang.String |
getPathInfo()
Returns any extra path information associated with the URL the client sent when it made this request. |
java.lang.String |
getServletPath()
Returns the part of this request's URL that calls the servlet. |
void |
setPathInfo(java.lang.String pathInfo)
|
void |
setServletPath(java.lang.String servletPath)
|
| Methods inherited from class org.apache.cactus.server.HttpServletRequestWrapper |
getLocalAddr, getLocalName, getLocalPort, getRemotePort |
| Methods inherited from class org.apache.cactus.server.AbstractHttpServletRequestWrapper23 |
getRequestURL, setCharacterEncoding |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
pathInfo
private java.lang.String pathInfo
servletPath
private java.lang.String servletPath
parameters
private java.util.Map parameters
| Constructor Detail |
StrutsRequestWrapper
public StrutsRequestWrapper(org.apache.cactus.server.HttpServletRequestWrapper request)
| Method Detail |
setPathInfo
public void setPathInfo(java.lang.String pathInfo)
getPathInfo
public java.lang.String getPathInfo()
- Description copied from interface:
javax.servlet.http.HttpServletRequest - Returns any extra path information associated with
the URL the client sent when it made this request.
The extra path information follows the servlet path
but precedes the query string and will start with
a "/" character.
This method returns
nullif there was no extra path information.Same as the value of the CGI variable PATH_INFO.
setServletPath
public void setServletPath(java.lang.String servletPath)
getServletPath
public java.lang.String getServletPath()
- Description copied from interface:
javax.servlet.http.HttpServletRequest - Returns the part of this request's URL that calls
the servlet. This path starts with a "/" character
and includes either the servlet name or a path to
the servlet, but does not include any extra path
information or a query string. Same as the value of
the CGI variable SCRIPT_NAME.
This method will return an empty string ("") if the servlet used to process this request was matched using the "/*" pattern.
getParameter
public java.lang.String getParameter(java.lang.String name)
- Description copied from interface:
javax.servlet.ServletRequest - Returns the value of a request parameter as a
String, ornullif the parameter does not exist. Request parameters are extra information sent with the request. For HTTP servlets, parameters are contained in the query string or posted form data.You should only use this method when you are sure the parameter has only one value. If the parameter might have more than one value, use ServletRequest.getParameterValues(java.lang.String)>
ServletRequest.getParameterValues(java.lang.String)55 .If you use this method with a multivalued parameter, the value returned is equal to the first value in the array returned by
getParameterValues.If the parameter data was sent in the request body, such as occurs with an HTTP POST request, then reading the body directly via ServletRequest.getInputStream()>
ServletRequest.getInputStream()55 or ServletRequest.getReader()>ServletRequest.getReader()55 can interfere with the execution of this method.
getParameterValues
public java.lang.String[] getParameterValues(java.lang.String name)
- Description copied from interface:
javax.servlet.ServletRequest - Returns an array of
Stringobjects containing all of the values the given request parameter has, ornullif the parameter does not exist.If the parameter has a single value, the array has a length of 1.
getParameterNames
public java.util.Enumeration getParameterNames()
- Description copied from interface:
javax.servlet.ServletRequest - Returns an
EnumerationofStringobjects containing the names of the parameters contained in this request. If the request has no parameters, the method returns an emptyEnumeration.
addParameter
public void addParameter(java.lang.String name, java.lang.String value)
addParameter
public void addParameter(java.lang.String name, java.lang.String[] values)
getParameterMap
public java.util.Map getParameterMap()
- Description copied from interface:
javax.servlet.ServletRequest - Returns a java.util.Map of the parameters of this request.
Request parameters
are extra information sent with the request. For HTTP servlets,
parameters are contained in the query string or posted form data.
clearRequestParameters
public void clearRequestParameters()
|
|||||||||
| Home >> All >> servletunit >> [ struts overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC