|
ehcache | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.ehcache.constructs.web.filter.Filter
public abstract class Filter
A generic Filter
with most of what we need done.
Filter
.
Field Summary | |
---|---|
protected java.lang.String |
exceptionsToLogDifferently
The exceptions to log differently, as a comma separated list |
protected java.lang.String |
exceptionsToLogDifferentlyLevel
A the level of the exceptions which will be logged differently |
protected javax.servlet.FilterConfig |
filterConfig
The filter configuration. |
static java.lang.String |
NO_FILTER
If a request attribute NO_FILTER is set, then filtering will be skipped |
protected boolean |
suppressStackTraces
Most Throwable s in Web applications propagate to the user. |
Constructor Summary | |
---|---|
Filter()
|
Method Summary | |
---|---|
protected boolean |
acceptsEncoding(javax.servlet.http.HttpServletRequest request,
java.lang.String name)
Checks if request accepts the named encoding. |
protected boolean |
acceptsGzipEncoding(javax.servlet.http.HttpServletRequest request)
Determine whether the user agent accepts GZIP encoding. |
void |
destroy()
Destroys the filter. |
protected abstract void |
doDestroy()
A template method that performs any Filter specific destruction tasks. |
protected abstract void |
doFilter(javax.servlet.http.HttpServletRequest httpRequest,
javax.servlet.http.HttpServletResponse httpResponse,
javax.servlet.FilterChain chain)
A template method that performs the filtering for a request. |
void |
doFilter(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response,
javax.servlet.FilterChain chain)
Performs the filtering. |
protected abstract void |
doInit()
A template method that performs any Filter specific initialisation tasks. |
protected boolean |
filterNotDisabled(javax.servlet.http.HttpServletRequest httpRequest)
Filters can be disabled programmatically by adding a NO_FILTER parameter to the request. |
javax.servlet.FilterConfig |
getFilterConfig()
Returns the filter config. |
void |
init(javax.servlet.FilterConfig config)
Initialises the filter. |
protected void |
logRequestHeaders(javax.servlet.http.HttpServletRequest request)
Logs the request headers, if debug is enabled. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String NO_FILTER
protected javax.servlet.FilterConfig filterConfig
protected java.lang.String exceptionsToLogDifferently
protected java.lang.String exceptionsToLogDifferentlyLevel
protected boolean suppressStackTraces
Throwable
s in Web applications propagate to the user. Usually they are logged where they first
happened. Printing the stack trace once a Throwable
as propagated to the servlet is sometimes
just clutters the log.
This field corresponds to an init-param of the same name. If set to true stack traces will be suppressed.
Constructor Detail |
---|
public Filter()
Method Detail |
---|
public final void doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain) throws javax.servlet.ServletException, java.io.IOException
doFilter(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse,javax.servlet.FilterChain)
which does the filtering.
This method takes care of error reporting and handling.
Errors are reported at Log.warn(Object)
level because http tends to produce lots of errors.
doFilter
in interface javax.servlet.Filter
java.io.IOException
- if an IOException occurs during this method it will be rethrown and will not be wrapped
javax.servlet.ServletException
protected boolean filterNotDisabled(javax.servlet.http.HttpServletRequest httpRequest)
NO_FILTER
parameter to the request.
This parameter is normally added to make RequestDispatcher include and forwards work.
httpRequest
- the request
public final void init(javax.servlet.FilterConfig config) throws javax.servlet.ServletException
doInit()
to perform any filter specific initialisation.
init
in interface javax.servlet.Filter
javax.servlet.ServletException
public final void destroy()
doDestroy()
to perform any filter specific
destruction tasks.
destroy
in interface javax.servlet.Filter
protected boolean acceptsEncoding(javax.servlet.http.HttpServletRequest request, java.lang.String name)
protected void logRequestHeaders(javax.servlet.http.HttpServletRequest request)
request
- protected abstract void doDestroy()
destroy()
protected abstract void doFilter(javax.servlet.http.HttpServletRequest httpRequest, javax.servlet.http.HttpServletResponse httpResponse, javax.servlet.FilterChain chain) throws java.lang.Throwable
doFilter(ServletRequest,ServletResponse,FilterChain)
.
java.lang.Throwable
protected abstract void doInit() throws java.lang.Exception
init(FilterConfig)
.
java.lang.Exception
public javax.servlet.FilterConfig getFilterConfig()
protected boolean acceptsGzipEncoding(javax.servlet.http.HttpServletRequest request)
Accept-Encoding: gzip
Requests which do not accept GZIP encoding fall into the following categories:
request
-
|
ehcache | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |