org.apache.tapestry5.urlrewriter
Class SimpleRequestWrapper

java.lang.Object
  extended by org.apache.tapestry5.services.DelegatingRequest
      extended by org.apache.tapestry5.urlrewriter.SimpleRequestWrapper
All Implemented Interfaces:
Request

public class SimpleRequestWrapper
extends DelegatingRequest

Class that wraps a Request. It delegates all methods except ones related to URL rewriting.


Constructor Summary
SimpleRequestWrapper(Request request, String path)
          Constructor that receives a request and a path.
SimpleRequestWrapper(Request request, String serverName, String path)
          Constructor that receives a request, a server name and a path.
 
Method Summary
 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.
 
Methods inherited from class org.apache.tapestry5.services.DelegatingRequest
getAttribute, getContextPath, getDateHeader, getHeader, getHeaderNames, getLocale, getMethod, getParameter, getParameterNames, getParameters, getSession, isRequestedSessionIdValid, isSecure, isXHR, setAttribute, setRequest
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleRequestWrapper

public SimpleRequestWrapper(Request request,
                            String serverName,
                            String path)
Constructor that receives a request, a server name and a path.

Parameters:
request - a Request. It cannot be null.
serverName - a String.
path - a String. It cannot be null.

SimpleRequestWrapper

public SimpleRequestWrapper(Request request,
                            String path)
Constructor that receives a request and a path. The server name used is got from the request.

Parameters:
request - a Request. It cannot be null.
path - a String. It cannot be null.
Method Detail

getPath

public String getPath()
Description copied from interface: Request
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.

Specified by:
getPath in interface Request
Overrides:
getPath in class DelegatingRequest

getServerName

public String getServerName()
Description copied from interface: Request
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.

Specified by:
getServerName in interface Request
Overrides:
getServerName in class DelegatingRequest
Returns:
the name of the server


Copyright © 2006-2009 Apache Software Foundation. All Rights Reserved.