|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.baswell.routes.RoutesFilter
public class RoutesFilter
An entry point for mapping HTTP servlet requests to route methods. This filter should be placed last in your filter chain. No filters in the chain below this filter will be processed when route method matches are found (i.e. chain.doFilter is not called). If no match is found, then chain.doFilter will be called so further processing can occur. This will allow, for example, to still serve up file resources (ex. html, jsp) directly as long as none of your routes match the file resource URL.
If your method routes are not the only mechanism for serving content, there are two parameters you can specify to improve the performance of this filter.
<init-param>
<param-name>ONLY</param-name>
<param-value>/api/.*,/routes/.*</param-value>
</init-param>
The
The other supported parameter is EXCEPT:
<init-param>
<param-name>EXCEPT</param-name>
<param-value>.*\.html$,.*\.jsp$</param-value>
</init-param>
The EXCEPT parameter must be a list (comma delimited) of valid Java regular expression. If specified, all request URIs will be checked to see if they match
any route method except those that match one of these patterns. The URI matched against will not include the context your application is deployed at so do not include that in the pattern.
If both ONLY and EXCEPT are specified then the route methods will not be checked if the ONLY pattern does not match or the EXCEPT pattern does match.
RoutesServlet,
RoutesEngine| Constructor Summary | |
|---|---|
RoutesFilter()
|
|
| Method Summary | |
|---|---|
void |
destroy()
|
void |
doFilter(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response,
javax.servlet.FilterChain chain)
|
void |
init(javax.servlet.FilterConfig filterConfig)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RoutesFilter()
| Method Detail |
|---|
public void init(javax.servlet.FilterConfig filterConfig)
throws javax.servlet.ServletException
init in interface javax.servlet.Filterjavax.servlet.ServletException
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.ServletExceptionpublic void destroy()
destroy in interface javax.servlet.Filter
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||