,ch14.9433 Page 458 Monday, February 14, 2005 12:55 PM
and a footer with legalese on the bottom. He also wants the summary page to be dis
played in a pop up window. There are three choices for implementing these changes:
Add the new sections to the existing JSPs.
Convert your application to use Tiles.
Use SiteMesh to adorn the existing site with the new sections.
If your site has only three pages, then the first solution is the most cost effective.
However, if your site has 300 pages, the first solution requires changing every page,
and the second solution requires refactoring your entire application.
The third solution, using SiteMesh, can be your savior. To install SiteMesh and
enable it for your web application, you need to do the following:
1. Download the SiteMesh full source ZIP file from http://www.opensymphony.com/
sitemesh. Version 2.2.1 was used for this recipe. Extract the ZIP file into a direc
tory named something like /sitemesh.
2. Copy all the JAR files from /sitemesh/lib into your application's WEB INF/lib
3. Add the SiteMesh servlet filter and corresponding filter mapping shown in
Example 14 14 to your application's web.xml file.
Example 14 14. SiteMesh servlet filter and mapping
4. Create the decorators.xml file shown in Example 14 15. Save this file to your
application's WEB INF directory.
Example 14 15. SiteMesh decorators configuration file
458 | Chapter 14: Tiles and Other Presentation Approaches
This is the Title of the Book, eMatter Edition
Copyright 2005 O'Reilly & Associates, Inc. All rights reserved.