|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.opensymphony.module.sitemesh.filter.PageFilter
public class PageFilter
Main SiteMesh filter for applying Decorators to entire Pages.
Field Summary | |
---|---|
protected Factory |
factory
|
protected FilterConfig |
filterConfig
|
Fields inherited from interface com.opensymphony.module.sitemesh.RequestConstants |
---|
DECORATOR, FILTER_APPLIED, PAGE, ROBOT, USING_STREAM |
Constructor Summary | |
---|---|
PageFilter()
|
Method Summary | |
---|---|
protected void |
applyDecorator(Page page,
Decorator decorator,
HttpServletRequest request,
HttpServletResponse response)
Apply Decorator to
Page and write to the response. |
void |
destroy()
Shutdown filter. |
void |
doFilter(ServletRequest rq,
ServletResponse rs,
FilterChain chain)
Main method of the Filter. |
private String |
extractRequestPath(HttpServletRequest request)
|
FilterConfig |
getFilterConfig()
Deprecated. Not needed in final version of Servlet 2.3 API - replaced by init(). |
void |
init(FilterConfig filterConfig)
Set FilterConfig, and get instance of DecoratorMapper . |
protected Page |
parsePage(HttpServletRequest request,
HttpServletResponse response,
FilterChain chain)
Continue in filter-chain, writing all content to buffer and parsing into returned Page object. |
void |
setFilterConfig(FilterConfig filterConfig)
Deprecated. Not needed in final version of Servlet 2.3 API - replaced by init(). |
protected void |
writeDecorator(HttpServletResponse response,
Page page,
RequestDispatcher dispatcher,
HttpServletRequest request)
|
private void |
writeOriginal(HttpServletRequest request,
HttpServletResponse response,
Page page)
Write the original page data to the response. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected FilterConfig filterConfig
protected Factory factory
Constructor Detail |
---|
public PageFilter()
Method Detail |
---|
public void doFilter(ServletRequest rq, ServletResponse rs, FilterChain chain) throws IOException, ServletException
Checks if the Filter has been applied this request. If not, parses the page
and applies Decorator
(if found).
doFilter
in interface Filter
IOException
ServletException
private String extractRequestPath(HttpServletRequest request)
public void init(FilterConfig filterConfig)
DecoratorMapper
.
init
in interface Filter
public FilterConfig getFilterConfig()
public void setFilterConfig(FilterConfig filterConfig)
public void destroy()
destroy
in interface Filter
protected Page parsePage(HttpServletRequest request, HttpServletResponse response, FilterChain chain) throws IOException, ServletException
Page
object. If
Page
is not parseable, null is returned.
IOException
ServletException
protected void applyDecorator(Page page, Decorator decorator, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
Decorator
to
Page
and write to the response.
ServletException
IOException
protected void writeDecorator(HttpServletResponse response, Page page, RequestDispatcher dispatcher, HttpServletRequest request) throws ServletException, IOException
ServletException
IOException
private void writeOriginal(HttpServletRequest request, HttpServletResponse response, Page page) throws IOException
IOException
|
www.opensymphony.com/sitemesh/ | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |