public class WebRequestImpl extends BaseWebRequest
BaseWebRequest
to add properties specific to the
Cactus Web Redirectors.GET_METHOD, POST_METHOD
Constructor and Description |
---|
WebRequestImpl()
Default constructor that requires that
BaseWebRequest.setConfiguration(Configuration) be called before the methods
requiring a configuration object. |
WebRequestImpl(WebConfiguration theConfiguration) |
Modifier and Type | Method and Description |
---|---|
boolean |
getAutomaticSession() |
java.lang.String |
getRedirectorName() |
HttpSessionCookie |
getSessionCookie()
Gets an HTTP session id by calling the server side and retrieving
the jsessionid cookie in the HTTP response.
|
ServletURL |
getURL() |
void |
setAutomaticSession(boolean isAutomaticSession) |
void |
setRedirectorName(java.lang.String theRedirectorName)
Override the redirector Name defined in
cactus.properties . |
void |
setURL(java.lang.String theServerName,
java.lang.String theContextPath,
java.lang.String theServletPath,
java.lang.String thePathInfo,
java.lang.String theQueryString)
Sets the simulated URL.
|
java.lang.String |
toString() |
addCookie, addCookie, addCookie, addHeader, addParameter, addParameter, getAuthentication, getConfiguration, getContentType, getCookies, getHeader, getHeaderNames, getHeaderValues, getParameterGet, getParameterNamesGet, getParameterNamesPost, getParameterPost, getParameterValuesGet, getParameterValuesPost, getUserData, setAuthentication, setConfiguration, setContentType, setUserData
public WebRequestImpl()
BaseWebRequest.setConfiguration(Configuration)
be called before the methods
requiring a configuration object.public WebRequestImpl(WebConfiguration theConfiguration)
theConfiguration
- the Cactus configurationpublic void setRedirectorName(java.lang.String theRedirectorName)
WebRequest
cactus.properties
.
This is useful to define a per test case Name (for example, if some
test case need to have authentication turned on and not other tests,
etc).theRedirectorName
- the new redirector Name to useWebRequest.setRedirectorName(String)
public java.lang.String getRedirectorName()
WebRequest.getRedirectorName()
public void setAutomaticSession(boolean isAutomaticSession)
isAutomaticSession
- whether the redirector servlet will
automatically create the HTTP session or not. Default is true.WebRequest.setAutomaticSession(boolean)
public boolean getAutomaticSession()
WebRequest.getAutomaticSession()
public void setURL(java.lang.String theServerName, java.lang.String theContextPath, java.lang.String theServletPath, java.lang.String thePathInfo, java.lang.String theQueryString)
WebRequest
URL = "http://" + serverName (including port) + requestURI ? queryString
requestURI = contextPath + servletPath + pathInfo
From the Servlet 2.2 specification :
- Context Path: The path prefix associated with the
ServletContext that this servlet is a part of. If this context is the
default context rooted at the base of the web server's URL namespace,
this path will be an empty string. Otherwise, this path starts with a
character but does not end with a character.
- Servlet Path: The path section that directly corresponds to
the mapping which activated this request. This path starts with a
character.
- PathInfo: The part of the request path that is not part of the
Context Path or the Servlet Path.
theServerName
- the server name (and port) in the URL to simulate,
i.e. this is the name that will be returned by the
HttpServletRequest.getServerName()
and
HttpServletRequest.getServerPort()
.theContextPath
- the webapp context path in the URL to simulate,
i.e. this is the name that will be returned by the
HttpServletRequest.getContextPath()
.
Can be null. Format: "/" + name or an empty string
for the default context.theServletPath
- the servlet path in the URL to simulate,
i.e. this is the name that will be returned by the
HttpServletRequest.getServletPath()
.
Can be null. Format : "/" + name.thePathInfo
- the path info in the URL to simulate, i.e. this is
the name that will be returned by the
HttpServletRequest.getPathInfo()
. Can
be null. Format : "/" + name.theQueryString
- the Query string in the URL to simulate, i.e. this
is the string that will be returned by the
HttpServletResquest.getQueryString()
.
Can be null.WebRequest.setURL(String, String, String, String, String)
public ServletURL getURL()
WebRequest.getURL()
public java.lang.String toString()
toString
in class BaseWebRequest
public HttpSessionCookie getSessionCookie()
WebRequest
HttpSessionCookie
objectWebRequest.getSessionCookie()
Copyright © 2000-2004 Apache Software Foundation. All Rights Reserved.