com.opensymphony.sitemesh.webapp
Class SiteMeshFilter
java.lang.Object
com.opensymphony.sitemesh.webapp.SiteMeshFilter
- All Implemented Interfaces:
- Filter
public class SiteMeshFilter
- extends Object
- implements Filter
Core Filter for integrating SiteMesh into a Java web application.
- Since:
- SiteMesh 3
- Author:
- Joe Walnes, Scott Farquhar
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
filterConfig
private FilterConfig filterConfig
containerTweaks
private ContainerTweaks containerTweaks
SiteMeshFilter
public SiteMeshFilter()
init
public void init(FilterConfig filterConfig)
- Specified by:
init
in interface Filter
destroy
public void destroy()
- Specified by:
destroy
in interface Filter
doFilter
public void doFilter(ServletRequest rq,
ServletResponse rs,
FilterChain chain)
throws IOException,
ServletException
- Main method of the Filter.
Checks if the Filter has been applied this request. If not, parses the page
and applies Decorator
(if found).
- Specified by:
doFilter
in interface Filter
- Throws:
IOException
ServletException
initContentProcessor
protected ContentProcessor initContentProcessor(SiteMeshWebAppContext webAppContext)
initDecoratorSelector
protected DecoratorSelector initDecoratorSelector(SiteMeshWebAppContext webAppContext)
obtainContent
private Content obtainContent(ContentProcessor contentProcessor,
SiteMeshWebAppContext webAppContext,
HttpServletRequest request,
HttpServletResponse response,
FilterChain chain)
throws IOException,
ServletException
- Continue in filter-chain, writing all content to buffer and parsing
into returned
Page
object. If
Page
is not parseable, null is returned.
- Throws:
IOException
ServletException
filterAlreadyAppliedForRequest
private boolean filterAlreadyAppliedForRequest(HttpServletRequest request)