|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.tapestry5.internal.test.TestableRequestImpl
public class TestableRequestImpl
| Constructor Summary | |
|---|---|
TestableRequestImpl()
|
|
TestableRequestImpl(String contextPath)
|
|
| Method Summary | |
|---|---|
void |
clear()
Clears the internal parameters map. |
Object |
getAttribute(String name)
Returns the value of the named attribute as an Object, or null if no attribute of the
given name exists. |
String |
getContextPath()
Returns the context path. |
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 named header as a string, or null if not found. |
List<String> |
getHeaderNames()
Returns the names of all headers in the request. |
Locale |
getLocale()
Returns the locale of the client as determined from the request headers. |
String |
getMethod()
Always returns POST, to keep the Form component happy. |
String |
getParameter(String name)
Returns the query parameter value for the given name. |
List<String> |
getParameterNames()
Returns a list of query parameter names, in alphabetical order. |
String[] |
getParameters(String name)
Returns the parameter values for the given name. |
String |
getPath()
Returns the path portion of the request, which starts with a "/" and contains everything up to the start of the query parameters. |
String |
getServerName()
Returns the host name of the server to which the request was sent. |
Session |
getSession(boolean create)
Gets the Session. |
boolean |
isRequestedSessionIdValid()
Always returns true. |
boolean |
isSecure()
Returns a boolean indicating whether this request was made using a secure channel, such as HTTPS. |
boolean |
isXHR()
Always returns false. |
void |
loadParameter(String parameterName,
String parameterValue)
Loads a single parameter/value pair. |
void |
loadParameters(Map<String,String> parameterValues)
Loads new parameter/value pairs into the map. |
void |
setAttribute(String name,
Object value)
Stores an attribute in this request. |
void |
setEncoding(String requestEncoding)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
@Inject public TestableRequestImpl()
public TestableRequestImpl(String contextPath)
| Method Detail |
|---|
public void clear()
TestableRequest
clear in interface TestableRequest
public void loadParameter(String parameterName,
String parameterValue)
TestableRequest
loadParameter in interface TestableRequestpublic void loadParameters(Map<String,String> parameterValues)
TestableRequest
loadParameters in interface TestableRequestpublic long getDateHeader(String name)
Requestlong 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 Requestname - 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 String getHeader(String name)
Request
getHeader in interface Requestpublic List<String> getHeaderNames()
Request
getHeaderNames in interface Requestpublic Locale getLocale()
Request
getLocale in interface Requestpublic List<String> getParameterNames()
Request
getParameterNames in interface Requestpublic String[] getParameters(String name)
Request
getParameters in interface Requestpublic String getPath()
Request
getPath in interface Requestpublic String getContextPath()
Request
getContextPath in interface Requestpublic String getParameter(String name)
Request
getParameter in interface Requestpublic Session getSession(boolean create)
RequestSession. If create is false and the session has not be created previously, returns null.
getSession in interface Requestcreate - true to force the creation of the session
public void setEncoding(String requestEncoding)
public boolean isXHR()
isXHR in interface Requestpublic boolean isSecure()
Request
isSecure in interface Requestpublic boolean isRequestedSessionIdValid()
isRequestedSessionIdValid in interface Requestpublic Object getAttribute(String name)
RequestObject, or null if no attribute of the
given name exists. Because this method is a wrapper around ServletRequest.getAttribute(String),
it is case sensitive (unlike most of Tapestry).
getAttribute in interface Requestname - a String specifying the name of the attribute
Object containing the value of the attribute, or null if the attribute does
not exist
public void setAttribute(String name,
Object value)
Request
setAttribute in interface Requestname - a String specifying the name of the attributevalue - the Object to be stored, or null to remove the attributepublic String getServerName()
RequestHost header, if any, or the resolved server name, or the server IP address.
getServerName in interface Requestpublic String getMethod()
getMethod in interface Request
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||