|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.tapestry.web.ServletWebRequest
public class ServletWebRequest
Adapter from HttpServletRequest to
WebRequest.
| Constructor Summary | |
|---|---|
ServletWebRequest(HttpServletRequest request,
HttpServletResponse response)
|
|
| Method Summary | |
|---|---|
void |
describeTo(DescriptionReceiver receiver)
Invoked to have the receiver describe itself (largely in terms of properties and values). |
void |
forward(String URL)
Redirects to the indicated URL. |
String |
getActivationPath()
Returns HttpServletRequest.getServletPath(). |
Object |
getAttribute(String name)
Returns the named object, or null if no attribute has been stored with the given name. |
List |
getAttributeNames()
Returns a list of all known attributes in ascending alphabetical order. |
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 WebSessionassociated 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". |
void |
setAttribute(String name,
Object attribute)
Updates the attribute, replacing (or removing) its value. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ServletWebRequest(HttpServletRequest request,
HttpServletResponse response)
| Method Detail |
|---|
public List getParameterNames()
WebRequest
getParameterNames in interface WebRequestpublic String getParameterValue(String parameterName)
WebRequest
getParameterValue in interface WebRequestparameterName - name of parameter to obtain
WebRequest.getParameterValues(String)public String[] getParameterValues(String parameterName)
WebRequestThe caller should not modify the returned value.
getParameterValues in interface WebRequestparameterName - name of parameter to obtain
WebRequest.getParameterValue(String)public String getContextPath()
WebRequest
getContextPath in interface WebRequestpublic WebSession getSession(boolean create)
WebRequestWebSessionassociated 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.
getSession in interface WebRequestcreate - if true, the session will be created and returned if it does not already exist
public List getAttributeNames()
AttributeHolder
getAttributeNames in interface AttributeHolderpublic Object getAttribute(String name)
AttributeHolder
getAttribute in interface AttributeHolder
public void setAttribute(String name,
Object attribute)
AttributeHolderWebSession
attribute in a clustered application).
setAttribute in interface AttributeHoldername - the name of the attribute to updateattribute - the new value for the attribute, or null to delete the attribute entirely.public String getScheme()
WebRequest
getScheme in interface WebRequestpublic String getServerName()
WebRequest
getServerName in interface WebRequestIRequestDecoderpublic int getServerPort()
WebRequest
getServerPort in interface WebRequestpublic String getRequestURI()
WebRequestNote: portlets do not know their request URI.
getRequestURI in interface WebRequestpublic void forward(String URL)
WebRequest
forward in interface WebRequestURL - The url to forward the request to.public String getActivationPath()
HttpServletRequest.getServletPath().
getActivationPath in interface WebRequestpublic String getPathInfo()
WebRequest
getPathInfo in interface WebRequestpublic Locale getLocale()
WebRequest
getLocale in interface WebRequestpublic void describeTo(DescriptionReceiver receiver)
DescribabletoString().
describeTo in interface Describablepublic String getHeader(String name)
WebRequest
getHeader in interface WebRequestname - the name of the header to retrieve
public long getDateHeader(String name)
WebRequestlong 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.
getDateHeader in interface WebRequestname - 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 reqestpublic int getIntHeader(String name)
WebRequestint. 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.
getIntHeader in interface WebRequestname - a String specifying the name
of a request header
public String getRemoteUser()
WebRequest
getRemoteUser in interface WebRequestpublic Principal getUserPrincipal()
WebRequest
getUserPrincipal in interface WebRequestpublic boolean isUserInRole(String role)
WebRequest
isUserInRole in interface WebRequestrole - a String specifying the name of the role
public boolean isSecure()
WebRequestHttpServletRequest. Indicates if this request is coming in on
a SSL/secure connection.
isSecure in interface WebRequest
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||