|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | POINTCUT | FIELD | CONSTRUCTOR | METHOD | DETAIL: FIELD | POINTCUT | CONSTRUCTOR | METHOD |
java.lang.Object | +--org.apache.cactus.ServletURL
Simulate an HTTP URL by breaking it into its different parts :
From the Servlet 2.2 specification :
URL = "http://" + serverName (including port) + requestURI ? queryString
requestURI = contextPath + servletPath + pathInfo
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(String theProtocol,
String theServerName,
String theContextPath,
String theServletPath,
String thePathInfo,
String theQueryString)
Creates the URL to simulate. |
|
ServletURL(String theServerName,
String theContextPath,
String theServletPath,
String thePathInfo,
String theQueryString)
Creates the URL to simulate, using the default HTTP protocol. |
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)
Creates a ServletURL object by loading it's values from the
HTTP request.
Affected by: LogAspect |
void |
saveToRequest(WebRequest theRequest)
Saves the current URL to a WebRequest object.
Affected by: LogAspect |
String |
toString()
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final String PROTOCOL_HTTP
public static final String PROTOCOL_HTTPS
public static final String URL_CONTEXT_PATH_PARAM
public static final String URL_PATH_INFO_PARAM
public static final String URL_PROTOCOL_PARAM
public static final String URL_QUERY_STRING_PARAM
public static final String URL_SERVER_NAME_PARAM
public static final String URL_SERVLET_PATH_PARAM
Constructor Detail |
public ServletURL(String theProtocol, String theServerName, String theContextPath, String theServletPath, String thePathInfo, String theQueryString)
theProtocol
- the protocol to simulate (either
ServletURL.PROTOCOL_HTTP
or
ServletUEL.PROTOCOL_HTTPS
.
theServerName
- the server name (and port) in the URL to simulate,
i.e. this is the name that will be returned by the
HttpServletRequest.getServerName()
and
HttpServletRequest.getServerPort()
. Can
be null. If null, then the server name and port from
the Servlet Redirector will be returned.
theContextPath
- the webapp context path in the URL to simulate,
i.e. this is the name that will be returned by the
HttpServletRequest.getContextPath()
.
Can be null. If null, then the context from the
Servlet Redirector will be returned.
Format: "/" + name or an empty string
for the default context.
theServletPath
- the servlet path in the URL to simulate,
i.e. this is the name that will be returned by the
HttpServletRequest.getServletPath()
.
Can be null. Format : "/" + name.
thePathInfo
- the path info in the URL to simulate, i.e. this is
the name that will be returned by the
HttpServletRequest.getPathInfo()
. Can
be null. Format : "/" + name.
theQueryString
- the Query string in the URL to simulate, i.e. this
is the string that will be returned by the
HttpServletResquest.getQueryString()
.
Can be null.
public ServletURL(String theServerName, String theContextPath, String theServletPath, String thePathInfo, String theQueryString)
theServerName
- the server name (and port) in the URL to simulate,
i.e. this is the name that will be returned by the
HttpServletRequest.getServerName()
and
HttpServletRequest.getServerPort()
. Can
be null. If null, then the server name and port from
the Servlet Redirector will be returned.
theContextPath
- the webapp context path in the URL to simulate,
i.e. this is the name that will be returned by the
HttpServletRequest.getContextPath()
.
Can be null. If null, then the context from the
Servlet Redirector will be returned.
Format: "/" + name or an empty string
for the default context.
theServletPath
- the servlet path in the URL to simulate,
i.e. this is the name that will be returned by the
HttpServletRequest.getServletPath()
.
Can be null. Format : "/" + name.
thePathInfo
- the path info in the URL to simulate, i.e. this is
the name that will be returned by the
HttpServletRequest.getPathInfo()
. Can
be null. Format : "/" + name.
theQueryString
- the Query string in the URL to simulate, i.e. this
is the string that will be returned by the
HttpServletResquest.getQueryString()
.
Can be null.
Method Detail |
public String getContextPath()
public String getHost()
public String getPath()
public String getPathInfo()
public int getPort()
public String getProtocol()
public String getQueryString()
public String getServerName()
public String getServletPath()
public static ServletURL loadFromRequest(HttpServletRequest theRequest)
ServletURL
object by loading it's values from the
HTTP request.
theRequest
- the incoming HTTP request.
ServletURL
object unserialized from the HTTP
request
around() in LogAspect
.public void saveToRequest(WebRequest theRequest)
WebRequest
object.
theRequest
- the object to which the current URL should be saved to
around() in LogAspect
.public String toString()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTRUCTOR | METHOD | DETAIL: FIELD | CONSTRUCTOR | METHOD |