public class SparkFilter extends Object implements javax.servlet.Filter
| Modifier and Type | Field and Description |
|---|---|
static String |
APPLICATION_CLASS_PARAM |
| Constructor and Description |
|---|
SparkFilter() |
| Modifier and Type | Method and Description |
|---|---|
void |
destroy() |
void |
doFilter(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response,
javax.servlet.FilterChain chain) |
protected SparkApplication |
getApplication(javax.servlet.FilterConfig filterConfig)
Returns an instance of
SparkApplication which on which init() will be called. |
void |
init(javax.servlet.FilterConfig filterConfig) |
public static final String APPLICATION_CLASS_PARAM
public void init(javax.servlet.FilterConfig filterConfig)
throws javax.servlet.ServletException
init in interface javax.servlet.Filterjavax.servlet.ServletExceptionprotected SparkApplication getApplication(javax.servlet.FilterConfig filterConfig) throws javax.servlet.ServletException
SparkApplication which on which init() will be called.
Default implementation looks up the class name in the filterConfig using the key APPLICATION_CLASS_PARAM.
Subclasses can override this method to use different techniques to obtain an instance (i.e. dependency injection).filterConfig - the filter configuration for retrieving parameters passed to this filter.javax.servlet.ServletException - if anything went wrong.public void doFilter(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response,
javax.servlet.FilterChain chain)
throws IOException,
javax.servlet.ServletException
doFilter in interface javax.servlet.FilterIOExceptionjavax.servlet.ServletExceptionpublic void destroy()
destroy in interface javax.servlet.FilterCopyright © 2016. All rights reserved.