org.sitemesh.webapp
Class SiteMeshFilter
java.lang.Object
org.sitemesh.webapp.contentfilter.ContentBufferingFilter
org.sitemesh.webapp.SiteMeshFilter
- All Implemented Interfaces:
- javax.servlet.Filter
public class SiteMeshFilter
- extends ContentBufferingFilter
The main SiteMesh Filter.
For this to be functional it requires a Selector, DecoratorSelector
and ContentProcessor. These must be passed in through the constructor.
This filter will not work on its own in a typical Servlet container as the container
will not know how to pass in the dependencies. It is designed for programmatic use, or
to work with frameworks that can inject dependencies. Alternatively, it can be
subclassed.
For an easy to configure implementation, use
ConfigurableSiteMeshFilter.
- Author:
- Joe Walnes, Scott Farquhar
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SiteMeshFilter
public SiteMeshFilter(Selector selector,
ContentProcessor contentProcessor,
DecoratorSelector<WebAppContext> decoratorSelector)
- Parameters:
selector - Provides the rules for whether SiteMesh should be
used for a specific request. For a basic implementation, use
BasicSelector.
postProcess
protected boolean postProcess(String contentType,
CharBuffer buffer,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
ResponseMetaData metaData)
throws IOException,
javax.servlet.ServletException
- Specified by:
postProcess in class ContentBufferingFilter
- Returns:
- Whether the content was processed. If false, the original content shall
be written back out.
- Throws:
IOException
javax.servlet.ServletException
createContext
protected WebAppContext createContext(String contentType,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
ResponseMetaData metaData)
- Create a context for the current request. This method can be overriden to allow for other
types of context.
Copyright © 2011. All Rights Reserved.