public class ProxyFilter extends Object implements javax.servlet.Filter
ProxyFilter -> MyServlet
We want to intercept the filter chain and add all of the required CAS filters in the correct order so the filter chain looks similar to the following:
ProxyFilter -> CAS filter 1 -> CAS filter 2 -> CAS filter n -> MyServlet
Note: Using blueprint to define the filters and publish them as services caused the filters to be added to the filter chain in an nondeterministic order. Setting service raking didn't work either. CAS relies on the filters being executed in a specific order.
Filter
Constructor and Description |
---|
ProxyFilter(List<javax.servlet.Filter> filters) |
Modifier and Type | Method and Description |
---|---|
void |
destroy() |
void |
doFilter(javax.servlet.ServletRequest servletRequest,
javax.servlet.ServletResponse servletResponse,
javax.servlet.FilterChain filterChain)
Adds all of the CAS filters to the filter chain and calls the filter chain so it can start
executing all of the CAS filters.
|
void |
init(javax.servlet.FilterConfig filterConfig) |
public ProxyFilter(List<javax.servlet.Filter> filters)
filters
- The CAS filters to add to the filter chain.public void destroy()
destroy
in interface javax.servlet.Filter
Filter.destroy()
public void doFilter(javax.servlet.ServletRequest servletRequest, javax.servlet.ServletResponse servletResponse, javax.servlet.FilterChain filterChain) throws IOException, javax.servlet.ServletException
doFilter
in interface javax.servlet.Filter
IOException
javax.servlet.ServletException
Filter.doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse,
javax.servlet.FilterChain)
public void init(javax.servlet.FilterConfig filterConfig) throws javax.servlet.ServletException
init
in interface javax.servlet.Filter
javax.servlet.ServletException
Filter.init(javax.servlet.FilterConfig)
This work is licensed under a Creative Commons Attribution 4.0 International License.