public class RequestContext extends java.lang.Object
ApplicationServlet
. This includes:
HttpServletRequest
HttpServletResponse
HttpSession
This is a limited and crippled version of the RequestContext as it was available in release 3.0,
that exists as a bridge for compatibility only. This saves developers from having to modify their
classes to have the HttpServletRequest
or (preferrably)
WebRequest
injected into their pages, components, or services. It
will be removed in the next release of Tapestry.
Constructor and Description |
---|
RequestContext(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
javax.servlet.http.HttpSession |
createSession()
Deprecated.
Like
getSession() , but forces the creation of the HttpSession , if
necessary. |
java.lang.Object |
getAttribute(java.lang.String name)
Deprecated.
Convienience method for getting a
HttpServletRequest attribute. |
java.lang.String |
getParameter(java.lang.String name)
Deprecated.
Returns the named parameter from the
HttpServletRequest . |
java.lang.String[] |
getParameterNames()
Deprecated.
|
java.lang.String[] |
getParameters(java.lang.String name)
Deprecated.
For parameters that are, or are possibly, multi-valued, this method returns all the values as
an array of Strings.
|
javax.servlet.http.HttpServletRequest |
getRequest()
Deprecated.
Returns the request which initiated the current request cycle.
|
javax.servlet.http.HttpServletResponse |
getResponse()
Deprecated.
|
javax.servlet.http.HttpSession |
getSession()
Deprecated.
Returns the
HttpSession , if necessary, invoking
HttpServletRequest.getSession(boolean) . |
public RequestContext(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
public java.lang.String getParameter(java.lang.String name)
HttpServletRequest
.
Use getParameters(String)
for parameters that may include multiple values.
public java.lang.Object getAttribute(java.lang.String name)
HttpServletRequest
attribute.public java.lang.String[] getParameters(java.lang.String name)
getParameter(String)
public java.lang.String[] getParameterNames()
public javax.servlet.http.HttpServletRequest getRequest()
getParameter(String)
and getParameters(String)
should be used, rather than
obtaining parameters directly from the request (since the RequestContext handles the
differences between normal and multipart/form requests).public javax.servlet.http.HttpServletResponse getResponse()
public javax.servlet.http.HttpSession getSession()
HttpSession
, if necessary, invoking
HttpServletRequest.getSession(boolean)
. However, this method will not
create a session.public javax.servlet.http.HttpSession createSession()
getSession()
, but forces the creation of the HttpSession
, if
necessary.