|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface WebRequest
Contains information about the current request, including URLs, schemes, parameters, properties
and attributes. This is essentially a generic version of
HttpServletRequest
. In some cases, certain methods will be
unsupported in some implementations (such as getHeader(String)
for Portlet Tapestry).
Method Summary | |
---|---|
void |
forward(String URL)
Redirects to the indicated URL. |
String |
getActivationPath()
Returns the path of the resource which activated this request (this is the equivalent of the servlet path for a servlet request). |
String |
getContextPath()
Returns the portion of the request URI that indicates the context of the request. |
long |
getDateHeader(String name)
Returns the value of the specified request header as a long value that represents a
Date object. |
String |
getHeader(String name)
Returns the value of the specified request header. |
int |
getIntHeader(String name)
Returns the value of the specified request header as an int . |
Locale |
getLocale()
Returns the preferred locale to which content should be localized, as specified by the client or by the container. |
List |
getParameterNames()
Returns the names of all query parameters for this request. |
String |
getParameterValue(String parameterName)
Returns a parameter value. |
String[] |
getParameterValues(String parameterName)
Returns all parameter values for a particular parameter name. |
String |
getPathInfo()
Return any additional path info beyond the servlet path itself. |
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. |
String |
getRequestURI()
Returns the path portion of the request which triggered this request. |
String |
getScheme()
Returns the name of the scheme used to make this request. |
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. |
Principal |
getUserPrincipal()
Returns a java.security.Principal object containing the name of the current authenticated user. |
boolean |
isSecure()
Taken from HttpServletRequest . |
boolean |
isUserInRole(String role)
* Returns a boolean indicating whether the authenticated user is included in the specified logical "role". |
Methods inherited from interface org.apache.tapestry.web.AttributeHolder |
---|
getAttribute, getAttributeNames, setAttribute |
Methods inherited from interface org.apache.tapestry.describe.Describable |
---|
describeTo |
Method Detail |
---|
List getParameterNames()
String getParameterValue(String parameterName)
parameterName
- name of parameter to obtain
getParameterValues(String)
String[] getParameterValues(String parameterName)
The caller should not modify the returned value.
parameterName
- name of parameter to obtain
getParameterValue(String)
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 exist
String getScheme()
String getServerName()
IRequestDecoder
int getServerPort()
String getRequestURI()
Note: portlets do not know their request URI.
void forward(String URL)
URL
- The url to forward the request to.String getActivationPath()
String getPathInfo()
Locale getLocale()
String getHeader(String name)
name
- the name of the header to retrieve
long getDateHeader(String name)
long
value that represents a
Date
object. Use this method with
headers that contain dates, such as
If-Modified-Since
.
The date is returned as the number of milliseconds since January 1, 1970 GMT. The header name is case insensitive.
If the request did not have a header of the
specified name, this method returns -1. If the header
can't be converted to a date, the method throws
an IllegalArgumentException
.
name
- a String
specifying the
name of the header
long
value representing the
date specified in the header expressed as the number
of milliseconds since January 1, 1970 GMT, or -1 if
the named header was not included with the reqest
IllegalArgumentException
- If the header value
can't be converted to a dateint getIntHeader(String name)
int
. If the request does not have a header
of the specified name, this method returns -1. If the
header cannot be converted to an integer, this method
throws a NumberFormatException
.
The header name is case insensitive.
name
- a String
specifying the name
of a request header
NumberFormatException
- If the header value can't be
converted to an int
String getRemoteUser()
Principal getUserPrincipal()
boolean isUserInRole(String role)
role
- a String specifying the name of the role
boolean isSecure()
HttpServletRequest
. Indicates if this request is coming in on
a SSL/secure connection.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |