org.apache.cactus
class ServletURL

java.lang.Object
  |
  +--org.apache.cactus.ServletURL
Known Advisors:
LogAspect

public class ServletURL
extends java.lang.Object

Simulate an HTTP URL by breaking it into its different parts :

 
URL = "http://" + serverName (including port) + requestURI ? queryString
requestURI = contextPath + servletPath + pathInfo
From the Servlet 2.2 specification :

Version:
$Id: ServletURL.html,v 1.1 2003/04/14 12:27:23 sinisa Exp $
Author:
Vincent Massol

Field Summary
static String PROTOCOL_HTTP
          Http protocol.
          
static String PROTOCOL_HTTPS
          Https protocol.
          
static String URL_CONTEXT_PATH_PARAM
          Name of the parameter in the HTTP request that represents the context path in the URL to simulate.
          
static String URL_PATH_INFO_PARAM
          Name of the parameter in the HTTP request that represents the Path Info in the URL to simulate.
          
static String URL_PROTOCOL_PARAM
          Name of the parameter in the HTTP request that represents the protocol (HTTP, HTTPS, etc) in the URL to simulate.
          
static String URL_QUERY_STRING_PARAM
          Name of the parameter in the HTTP request that represents the Query String in the URL to simulate.
          
static String URL_SERVER_NAME_PARAM
          Name of the parameter in the HTTP request that represents the Server name (+ port) in the URL to simulate.
          
static String URL_SERVLET_PATH_PARAM
          Name of the parameter in the HTTP request that represents the Servlet Path in the URL to simulate.
          
 
Constructor Summary
ServletURL()
           
ServletURL(String theProtocol, String theServerName, String theContextPath, String theServletPath, String thePathInfo, String theQueryString)
           
ServletURL(String theServerName, String theContextPath, String theServletPath, String thePathInfo, String theQueryString)
           
 
Method Summary
 String getContextPath()
           
 String getHost()
           
 String getPath()
           
 String getPathInfo()
           
 int getPort()
           
 String getProtocol()
           
 String getQueryString()
           
 String getServerName()
           
 String getServletPath()
           
static ServletURL loadFromRequest(HttpServletRequest theRequest)
           Affected by: LogAspect
 void saveToRequest(WebRequest theRequest)
           Affected by: LogAspect
 void setContextPath(String theContextPath)
           Affected by: LogAspect
 void setPathInfo(String thePathInfo)
           Affected by: LogAspect
 void setProtocol(String theProtocol)
           Affected by: LogAspect
 void setQueryString(String theQueryString)
           Affected by: LogAspect
 void setServerName(String theServerName)
           Affected by: LogAspect
 void setServletPath(String theServletPath)
           Affected by: LogAspect
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PROTOCOL_HTTP

public static final String PROTOCOL_HTTP
Http protocol.

PROTOCOL_HTTPS

public static final String PROTOCOL_HTTPS
Https protocol.

URL_CONTEXT_PATH_PARAM

public static final String URL_CONTEXT_PATH_PARAM
Name of the parameter in the HTTP request that represents the context path in the URL to simulate. The name is voluntarily long so that it will not clash with a user-defined parameter.

URL_PATH_INFO_PARAM

public static final String URL_PATH_INFO_PARAM
Name of the parameter in the HTTP request that represents the Path Info in the URL to simulate. The name is voluntarily long so that it will not clash with a user-defined parameter.

URL_PROTOCOL_PARAM

public static final String URL_PROTOCOL_PARAM
Name of the parameter in the HTTP request that represents the protocol (HTTP, HTTPS, etc) in the URL to simulate. The name is voluntarily long so that it will not clash with a user-defined parameter.

URL_QUERY_STRING_PARAM

public static final String URL_QUERY_STRING_PARAM
Name of the parameter in the HTTP request that represents the Query String in the URL to simulate. The name is voluntarily long so that it will not clash with a user-defined parameter.

URL_SERVER_NAME_PARAM

public static final String URL_SERVER_NAME_PARAM
Name of the parameter in the HTTP request that represents the Server name (+ port) in the URL to simulate. The name is voluntarily long so that it will not clash with a user-defined parameter.

URL_SERVLET_PATH_PARAM

public static final String URL_SERVLET_PATH_PARAM
Name of the parameter in the HTTP request that represents the Servlet Path in the URL to simulate. The name is voluntarily long so that it will not clash with a user-defined parameter.
Constructor Detail

ServletURL

public ServletURL()

ServletURL

public ServletURL(String theProtocol,
                  String theServerName,
                  String theContextPath,
                  String theServletPath,
                  String thePathInfo,
                  String theQueryString)

ServletURL

public ServletURL(String theServerName,
                  String theContextPath,
                  String theServletPath,
                  String thePathInfo,
                  String theQueryString)
Method Detail

getContextPath

public String getContextPath()

getHost

public String getHost()

getPath

public String getPath()

getPathInfo

public String getPathInfo()

getPort

public int getPort()

getProtocol

public String getProtocol()

getQueryString

public String getQueryString()

getServerName

public String getServerName()

getServletPath

public String getServletPath()

loadFromRequest

public static ServletURL loadFromRequest(HttpServletRequest theRequest)
Affected by:
around() in LogAspect.

saveToRequest

public void saveToRequest(WebRequest theRequest)
Affected by:
around() in LogAspect.

setContextPath

public void setContextPath(String theContextPath)
Affected by:
around() in LogAspect.

setPathInfo

public void setPathInfo(String thePathInfo)
Affected by:
around() in LogAspect.

setProtocol

public void setProtocol(String theProtocol)
Affected by:
around() in LogAspect.

setQueryString

public void setQueryString(String theQueryString)
Affected by:
around() in LogAspect.

setServerName

public void setServerName(String theServerName)
Affected by:
around() in LogAspect.

setServletPath

public void setServletPath(String theServletPath)
Affected by:
around() in LogAspect.

toString

public String toString()


Copyright © 2000-2002 Apache Software Foundation. All Rights Reserved.