Java Reference
In-Depth Information
First, add the SiteMesh filter at the top of the file, before all other
elements:
Download email_18/web/WEB-INF/web.xml
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
>
<filter>
<filter-name> SiteMesh </filter-name>
<filter-class>
com.opensymphony.module.sitemesh.filter.PageFilter
</filter-class>
</filter>
<filter-mapping>
<filter-name> SiteMesh </filter-name>
<url-pattern> / * </url-pattern>
</filter-mapping>
<!-- ... -->
Next, add the INCLUDE and ERROR dispatchers to the Stripes filter:
Download email_18/web/WEB-INF/web.xml
<filter-mapping>
<filter-name> StripesFilter </filter-name>
<servlet-name> DispatcherServlet </servlet-name>
<dispatcher> REQUEST </dispatcher>
<dispatcher> FORWARD </dispatcher>
<dispatcher> INCLUDE </dispatcher>
<dispatcher> ERROR </dispatcher>
</filter-mapping>
Finally, add a mapping for *.jsp to the Stripes filter:
Download email_18/web/WEB-INF/web.xml
<filter-mapping>
<filter-name> StripesFilter </filter-name>
<url-pattern> * .jsp </url-pattern>
<dispatcher> REQUEST </dispatcher>
<dispatcher> FORWARD </dispatcher>
<dispatcher> INCLUDE </dispatcher>
<dispatcher> ERROR </dispatcher>
</filter-mapping>
SiteMesh is now ready. Discussing how SiteMesh works is outside the
scope of this topic (had to use that “outside the scope” phrase, didn't
I?), but, again, you'll find a working example in the topic's sample code.
 
 
Search WWH ::




Custom Search