Home » tapestry-src-5.0.19 » org.apache.tapestry5.services » [javadoc | source]
org.apache.tapestry5.services
public interface: Request [javadoc | source]

All Known Implementing Classes:
    RequestImpl

Generic version of javax.servlet.http.HttpServletRequest , used to encapsulate the Servlet API version, and to help bridge the differences between Servlet API and Porlet API.

The Request service is a {@linkplain org.apache.tapestry5.ioc.services.PropertyShadowBuilder shadow} of the current thread's request.
Method from org.apache.tapestry5.services.Request Summary:
getAttribute,   getContextPath,   getDateHeader,   getHeader,   getHeaderNames,   getLocale,   getMethod,   getParameter,   getParameterNames,   getParameters,   getPath,   getServerName,   getSession,   isRequestedSessionIdValid,   isSecure,   isXHR,   setAttribute
Method from org.apache.tapestry5.services.Request Detail:
 public Object getAttribute(String name)
 public String getContextPath()
    Returns the context path. This always starts with a "/" character and does not end with one, with the exception of servlets in the root context, which return the empty string.
 public long getDateHeader(String name)
    Returns the value of the specified request header as a 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.

 public String getHeader(String name)
    Returns the named header as a string, or null if not found.
 public List<String> getHeaderNames()
    Returns the names of all headers in the request.
 public Locale getLocale()
    Returns the locale of the client as determined from the request headers.
 public String getMethod()
    Returns the name of the HTTP method with which this request was made, for example, GET, POST, or PUT.
 public String getParameter(String name)
    Returns the query parameter value for the given name. Returns null if no such parameter is in the request. For a multi-valued parameter, returns just the first value.
 public List<String> getParameterNames()
    Returns a list of query parameter names, in alphabetical order.
 public String[] getParameters(String name)
    Returns the parameter values for the given name. Returns null if no such parameter is in the request.
 public String getPath()
    Returns the path portion of the request, which starts with a "/" and contains everything up to the start of the query parameters. It doesn't include the context path.
 public String getServerName()
    Returns the host name of the server to which the request was sent. It is the value of the part before ":" in the Host header, if any, or the resolved server name, or the server IP address.
 public Session getSession(boolean create)
    Gets the Session . If create is false and the session has not be created previously, returns null.
 public boolean isRequestedSessionIdValid()
    Checks whether the requested session ID is still valid.
 public boolean isSecure()
    Returns a boolean indicating whether this request was made using a secure channel, such as HTTPS.
 public boolean isXHR()
    Returns true if the request originated on the client using XmlHttpRequest (the core of any Ajax behavior). Ajax action requests may behave quite differently than ordinary, page-based requests. This implementation currently depends on the client side setting a header: X-Requested-With=XMLHttpRequest (this is what Prototype does).
 public  void setAttribute(String name,
    Object value)
    Stores an attribute in this request. Attributes are reset between requests (and remember that in Tapestry, there is usually two requests per operation: the action request that redirects to a render request).