|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.cactus.internal.BaseWebRequest
org.apache.cactus.internal.WebRequestImpl
public class WebRequestImpl
Extends BaseWebRequest
to add properties specific to the
Cactus Web Redirectors.
Field Summary |
---|
Fields inherited from interface org.apache.cactus.WebRequest |
---|
GET_METHOD, POST_METHOD |
Constructor Summary | |
---|---|
WebRequestImpl()
Default constructor that requires that BaseWebRequest.setConfiguration(Configuration) be called before the methods
requiring a configuration object. |
|
WebRequestImpl(WebConfiguration theConfiguration)
|
Method Summary | |
---|---|
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()
|
Methods inherited from class org.apache.cactus.internal.BaseWebRequest |
---|
addCookie, addCookie, addCookie, addHeader, addParameter, addParameter, getAuthentication, getConfiguration, getContentType, getCookies, getHeader, getHeaderNames, getHeaderValues, getParameterGet, getParameterNamesGet, getParameterNamesPost, getParameterPost, getParameterValuesGet, getParameterValuesPost, getUserData, setAuthentication, setConfiguration, setContentType, setUserData |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public WebRequestImpl()
BaseWebRequest.setConfiguration(Configuration)
be called before the methods
requiring a configuration object.
public WebRequestImpl(WebConfiguration theConfiguration)
theConfiguration
- the Cactus configurationMethod Detail |
---|
public void setRedirectorName(java.lang.String theRedirectorName)
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)
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()
HttpSessionCookie
objectWebRequest.getSessionCookie()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |