|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.weborganic.berlioz.servlet.RedirectFilter
public final class RedirectFilter
A basic filter to redirect URI patterns to other URI patterns.
The redirect mapping can be specified as below:
<?xml version="1.0" encoding="utf-8"?>
<redirect-mapping>
<redirect from="/" to="/html/home"/>
<redirect from="/index.html" to="/html/home"/>
<redirect from="/html" to="/html/home"/>
<redirect from="/xml" to="/xml/home"/>
<redirect from="/{+path}.psml" to="/html/{+path}"/>
</redirect-mapping>
All redirects are currently temporary (302) unless the attribute 'permanent' is set to 'yes' in which case the HTTP code will be 301
See #init(javax.servlet.ServletConfig)
for details for configuration options.
Constructor Summary | |
---|---|
RedirectFilter()
|
Method Summary | |
---|---|
void |
destroy()
|
void |
doFilter(javax.servlet.ServletRequest req,
javax.servlet.ServletResponse res,
javax.servlet.FilterChain chain)
|
void |
doHTTPFilter(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res,
javax.servlet.FilterChain chain)
Do the filtering for a HTTP request. |
void |
init(javax.servlet.FilterConfig config)
Initialises the Redirector Servlet. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RedirectFilter()
Method Detail |
---|
public void init(javax.servlet.FilterConfig config)
This servlet accepts the following init parameters:
config
path to the URI redirect mapping XML file (eg. '/config/redirect.xml')
init
in interface javax.servlet.Filter
config
- The filter configuration.Servlet.init(javax.servlet.ServletConfig)
public void destroy()
destroy
in interface javax.servlet.Filter
public void doFilter(javax.servlet.ServletRequest req, javax.servlet.ServletResponse res, javax.servlet.FilterChain chain) throws javax.servlet.ServletException, IOException
doFilter
in interface javax.servlet.Filter
javax.servlet.ServletException
IOException
public void doHTTPFilter(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, javax.servlet.FilterChain chain) throws javax.servlet.ServletException, IOException
req
- The HTTP servlet request.res
- The HTTP servlet response.chain
- The filter chain.
IOException
- Should an error occurs while writing the response.
javax.servlet.ServletException
- If thrown by the filter chain.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |