public abstract class AbstractTemplateFilter extends Object implements javax.servlet.Filter
Filter
implementation that can be used to realize basic templating.Constructor and Description |
---|
AbstractTemplateFilter() |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
applyFilter(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
javax.servlet.FilterChain chain)
Apply the filter to the given request/response.
|
void |
destroy() |
void |
doFilter(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response,
javax.servlet.FilterChain chain) |
protected String |
getWebResourceContents(String name)
Returns the string contents of a web resource with the given name.
|
protected boolean |
hasWebResource(String name)
Returns true if the given web resource exists.
|
void |
init(javax.servlet.FilterConfig filterConfig) |
public void init(javax.servlet.FilterConfig filterConfig) throws javax.servlet.ServletException
init
in interface javax.servlet.Filter
javax.servlet.ServletException
public void destroy()
destroy
in interface javax.servlet.Filter
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.Filter
IOException
javax.servlet.ServletException
protected abstract void applyFilter(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.FilterChain chain) throws IOException, javax.servlet.ServletException
request
- response
- chain
- IOException
javax.servlet.ServletException
protected boolean hasWebResource(String name)
name
- protected String getWebResourceContents(String name) throws IOException
name
- the name of the resourceIOException
Copyright © 2017. All rights reserved.