public class SiteMeshFilterBuilder extends BaseSiteMeshFilterBuilder<SiteMeshFilterBuilder>
Filter
.
This follows the API builder pattern - each method returns a reference to the original builder
so they can be chained together. When configured, call the create()
method which will
return the final immutable Filter
.
// Simplest example... Filter siteMeshFilter = new SiteMeshFilterBuilder() .addDecoratorPath("/*", "/decorator.html") .create(); // A few more options (shows applying multiple decorators to a single page)... Filter siteMeshFilter = new SiteMeshFilterBuilder() .addDecoratorPaths("/*", "/decorators/main-layout.html", "/decorators-common-style.html") .addDecoratorPaths("/admin/*", "/decorators/admin-layout.html", "/decorators-common-style.html") .addTagRuleBundle(new MyLinkRewriterBundle()) .addExcludePath("/javadoc/*") .addExcludePath("/portfolio/*") .create(); // If you want to get a bit crazy and totally customize SiteMesh... Filter siteMeshFilter = new SiteMeshFilterBuilder() .setMimeTypes("image/svg+xml") .setCustomContentProcessor(new MySvgContentProcessor()) .setCustomDecoratorSelector(new MyDatabaseDrivenDecoratorSelector()) .create();
This is only for advanced users who need to change the behavior of the builder...
If you ever find the need to subclass SiteMeshFilterBuilder (e.g. to add more convenience
methods, to change the implementation returned, or add new functionality), it is instead recommended
that you extends BaseSiteMeshFilterBuilder
. This way, the generic type signature can
be altered.
Constructor and Description |
---|
SiteMeshFilterBuilder() |
Modifier and Type | Method and Description |
---|---|
javax.servlet.Filter |
create()
Create the SiteMesh Filter.
|
addExcludedPath, getSelector, isIncludeErrorPages, setCustomSelector, setIncludeErrorPages, setMimeTypes, setMimeTypes, setupDefaults
addDecoratorPath, addDecoratorPaths, addDecoratorPaths, addTagRuleBundle, addTagRuleBundles, addTagRuleBundles, clearTagRuleBundles, getContentProcessor, getDecoratorSelector, self, setCustomContentProcessor, setCustomDecoratorSelector, setTagRuleBundles, setTagRuleBundles
public javax.servlet.Filter create()
create
in class BaseSiteMeshFilterBuilder<SiteMeshFilterBuilder>
Copyright © 2015. All Rights Reserved.