public class SiteMeshFilter
extends java.lang.Object
implements javax.servlet.Filter
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
ALREADY_APPLIED_KEY |
private ContainerTweaks |
containerTweaks |
private javax.servlet.FilterConfig |
filterConfig |
Constructor and Description |
---|
SiteMeshFilter() |
Modifier and Type | Method and Description |
---|---|
void |
destroy() |
void |
doFilter(javax.servlet.ServletRequest rq,
javax.servlet.ServletResponse rs,
javax.servlet.FilterChain chain)
Main method of the Filter.
|
private boolean |
filterAlreadyAppliedForRequest(javax.servlet.http.HttpServletRequest request) |
void |
init(javax.servlet.FilterConfig filterConfig) |
protected ContentProcessor |
initContentProcessor(SiteMeshWebAppContext webAppContext) |
protected DecoratorSelector |
initDecoratorSelector(SiteMeshWebAppContext webAppContext) |
private Content |
obtainContent(ContentProcessor contentProcessor,
SiteMeshWebAppContext webAppContext,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
javax.servlet.FilterChain chain)
Continue in filter-chain, writing all content to buffer and parsing
into returned
Page object. |
private javax.servlet.FilterConfig filterConfig
private ContainerTweaks containerTweaks
private static final java.lang.String ALREADY_APPLIED_KEY
public void init(javax.servlet.FilterConfig filterConfig)
init
in interface javax.servlet.Filter
public void destroy()
destroy
in interface javax.servlet.Filter
public void doFilter(javax.servlet.ServletRequest rq, javax.servlet.ServletResponse rs, javax.servlet.FilterChain chain) throws java.io.IOException, javax.servlet.ServletException
Checks if the Filter has been applied this request. If not, parses the page
and applies Decorator
(if found).
doFilter
in interface javax.servlet.Filter
java.io.IOException
javax.servlet.ServletException
protected ContentProcessor initContentProcessor(SiteMeshWebAppContext webAppContext)
protected DecoratorSelector initDecoratorSelector(SiteMeshWebAppContext webAppContext)
private Content obtainContent(ContentProcessor contentProcessor, SiteMeshWebAppContext webAppContext, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.FilterChain chain) throws java.io.IOException, javax.servlet.ServletException
Page
object. If
Page
is not parseable, null is returned.java.io.IOException
javax.servlet.ServletException
private boolean filterAlreadyAppliedForRequest(javax.servlet.http.HttpServletRequest request)