|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectau.com.lastweekend.pathinfo.PathInfoFilter
public class PathInfoFilter
Allow URLS of the form context/*.ext/pathInfo
There is no way to directly map a servlet so that context/anyscript.cgi/somePathInfo ends up with a
request with servletPath = context/anyscript.cgi, pathInfo = somePathInfo
Either map *.cgi which won't match or map context/specificscript.cgi/somePathInfo which can only match those scripts that are specifically mapped.
Map a PHP servlet to "*.php"
TODO: Allow multiple pathSpecs to be matched.
| Constructor Summary | |
|---|---|
PathInfoFilter()
|
|
| Method Summary | |
|---|---|
void |
destroy()
|
void |
doFilter(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
javax.servlet.FilterChain chain)
The filter operation. |
void |
doFilter(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response,
javax.servlet.FilterChain chain)
|
void |
init(javax.servlet.FilterConfig config)
|
void |
setPathSpec(java.lang.String pathSpec)
Init-param "pathSpec" of the form "context*extension" but typically "context/*.ext" |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PathInfoFilter()
| Method Detail |
|---|
public void init(javax.servlet.FilterConfig config)
throws javax.servlet.ServletException
init in interface javax.servlet.Filterjavax.servlet.ServletExceptionpublic void destroy()
destroy in interface javax.servlet.Filter
public void doFilter(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response,
javax.servlet.FilterChain chain)
throws java.io.IOException,
javax.servlet.ServletException
doFilter in interface javax.servlet.Filterjava.io.IOException
javax.servlet.ServletException
public void doFilter(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
javax.servlet.FilterChain chain)
throws javax.servlet.ServletException,
java.io.IOException
If request.servletPath() matches the pathSpec
ie begins with context and has a path component ending in extension.
wrap providing new implementations of getServletPath() and getServletPathInfo() and forward otherwise pass through to the chain.
TODO: Find out what should happen when extension appears more than once. eg (phpinfo.php/phpinfo.php/pathInfo).
request - response - chain -
javax.servlet.ServletException
java.io.IOExceptionpublic void setPathSpec(java.lang.String pathSpec)
pathSpec -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||