public class UrlRewriter
extends java.lang.Object
| 构造器和说明 |
|---|
UrlRewriter(Conf conf) |
| 限定符和类型 | 方法和说明 |
|---|---|
java.lang.String |
decodeRequestString(javax.servlet.http.HttpServletRequest request,
java.lang.String source)
Decode the string with a URLDecoder.
|
void |
destroy()
Destory the rewriter gracefully.
|
Conf |
getConf() |
java.lang.String |
getContextPath(javax.servlet.http.HttpServletRequest request)
Return the context path for the given request, detecting an include request
URL if called within a RequestDispatcher include.
|
java.lang.String |
getPathWithinApplication(javax.servlet.http.HttpServletRequest request)
Return the path within the web application for the given request.
|
RewrittenUrl |
handleInvocationTargetException(javax.servlet.http.HttpServletRequest hsRequest,
javax.servlet.http.HttpServletResponse hsResponse,
java.lang.reflect.InvocationTargetException e)
Handle an exception thrown by a Run element.
|
RewrittenUrl |
processRequest(javax.servlet.http.HttpServletRequest hsRequest,
javax.servlet.http.HttpServletResponse hsResponse)
Helpful for testing but otherwise, don't use.
|
boolean |
processRequest(javax.servlet.http.HttpServletRequest hsRequest,
javax.servlet.http.HttpServletResponse hsResponse,
javax.servlet.FilterChain parentChain)
The main method called for each request that this filter is mapped for.
|
public UrlRewriter(Conf conf)
public RewrittenUrl processRequest(javax.servlet.http.HttpServletRequest hsRequest, javax.servlet.http.HttpServletResponse hsResponse) throws java.io.IOException, javax.servlet.ServletException, java.lang.reflect.InvocationTargetException
hsRequest - HttpServletRequesthsResponse - HttpServletResponsejava.io.IOException - IOExceptionjavax.servlet.ServletException - ServletExceptionjava.lang.reflect.InvocationTargetException - InvocationTargetExceptionpublic boolean processRequest(javax.servlet.http.HttpServletRequest hsRequest,
javax.servlet.http.HttpServletResponse hsResponse,
javax.servlet.FilterChain parentChain)
throws java.io.IOException,
javax.servlet.ServletException
hsRequest - The request to process.hsResponse - HttpServletResponseparentChain - FilterChainjava.io.IOException - IOExceptionjavax.servlet.ServletException - ServletExceptionpublic java.lang.String getPathWithinApplication(javax.servlet.http.HttpServletRequest request)
request - HttpServletRequestpublic java.lang.String getContextPath(javax.servlet.http.HttpServletRequest request)
request - HttpServletRequestpublic java.lang.String decodeRequestString(javax.servlet.http.HttpServletRequest request,
java.lang.String source)
request - HttpServletRequestsource - Stringpublic RewrittenUrl handleInvocationTargetException(javax.servlet.http.HttpServletRequest hsRequest, javax.servlet.http.HttpServletResponse hsResponse, java.lang.reflect.InvocationTargetException e) throws javax.servlet.ServletException, java.io.IOException
hsRequest - HttpServletRequesthsResponse - HttpServletResponsee - InvocationTargetExceptionjavax.servlet.ServletException - ServletExceptionjava.io.IOException - IOExceptionpublic Conf getConf()
public void destroy()