public interface WebRequest extends AttributeHolder, Describable
HttpServletRequest
. In some cases, certain methods will be
unsupported in some implementations (such as getHeader(String)
for Portlet Tapestry).Modifier and Type | Method and Description |
---|---|
void |
forward(java.lang.String URL)
Redirects to the indicated URL.
|
java.lang.String |
getActivationPath()
Returns the path of the resource which activated this request (this is the equivalent of the
servlet path for a servlet request).
|
java.lang.String |
getContextPath()
Returns the portion of the request URI that indicates the context of the request.
|
java.lang.String |
getHeader(java.lang.String name)
Returns the value of the specified request header.
|
java.util.Locale |
getLocale()
Returns the preferred locale to which content should be localized, as specified by the client
or by the container.
|
java.util.List |
getParameterNames()
Returns the names of all query parameters for this request.
|
java.lang.String |
getParameterValue(java.lang.String parameterName)
Returns a parameter value.
|
java.lang.String[] |
getParameterValues(java.lang.String parameterName)
Returns all parameter values for a particular parameter name.
|
java.lang.String |
getPathInfo()
Return any additional path info beyond the servlet path itself.
|
java.lang.String |
getRemoteUser()
Returns the login of the user making this request, if the user has been authenticated, or
null if the user has not been authenticated.
|
java.lang.String |
getRequestURI()
Returns the path portion of the request which triggered this request.
|
java.lang.String |
getScheme()
Returns the name of the scheme used to make this request.
|
java.lang.String |
getServerName()
Returns the host name of the server that received the request.
|
int |
getServerPort()
Returns the port number on which this request was received.
|
WebSession |
getSession(boolean create)
Returns the current
WebSession associated with this request, possibly creating it if
it does not already exist. |
java.security.Principal |
getUserPrincipal()
Returns a java.security.Principal object containing the name of the current authenticated
user.
|
boolean |
isUserInRole(java.lang.String role)
* Returns a boolean indicating whether the authenticated user is included in the specified
logical "role".
|
getAttribute, getAttributeNames, setAttribute
describeTo
java.util.List getParameterNames()
java.lang.String getParameterValue(java.lang.String parameterName)
parameterName
- name of parameter to obtaingetParameterValues(String)
java.lang.String[] getParameterValues(java.lang.String parameterName)
The caller should not modify the returned value.
parameterName
- name of parameter to obtaingetParameterValue(String)
java.lang.String getContextPath()
WebSession getSession(boolean create)
WebSession
associated with this request, possibly creating it if
it does not already exist. If create is false and the request has no valid session, this
method returns null. To make sure the session is properly maintained, you must call this
method before the response is committed.create
- if true, the session will be created and returned if it does not already existjava.lang.String getScheme()
java.lang.String getServerName()
IRequestDecoder
int getServerPort()
java.lang.String getRequestURI()
Note: portlets do not know their request URI.
void forward(java.lang.String URL)
java.lang.String getActivationPath()
java.lang.String getPathInfo()
java.util.Locale getLocale()
java.lang.String getHeader(java.lang.String name)
name
- the name of the header to retrievejava.lang.String getRemoteUser()
java.security.Principal getUserPrincipal()
boolean isUserInRole(java.lang.String role)
role
- a String specifying the name of the role