,ch14.9433  Page 459  Monday, February 14, 2005  12:55 PM
You are ready to define the decorating content to be added to your existing JSPs.
Create the web/decorators directory. This directory, similar to the layouts directory
used in a Tiles based application, contains your decorating JSP pages and stylesheet.
Example 14 16 shows the mainDecorator.jsp page.
Example 14 16. Main decorator JSP page
<%@ taglib prefix="decorator" uri="http://www.opensymphony.com/sitemesh/decorator" %>
<%@ taglib prefix="page" uri="http://www.opensymphony.com/sitemesh/page" %>
<%@ taglib prefix="bean" uri="http://struts.apache.org/tags bean" %>
<%@ taglib prefix="html" uri="http://struts.apache.org/tags html" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    
        </font></pre></span>
<span name = "INTRA" style='top:467px; left:219px' class="ft3"><pre><font face='Arial'>            <decorator:title default="{ Unknown Page   shouldn t see this, since</font></pre></span>
<span name = "INTRA" style='top:484px; left:219px' class="ft3"><pre><font face='Arial'>                                        pages should define title }" /></font></pre></span>
<span name = "INTRA" style='top:501px; left:219px' class="ft3"><pre><font face='Arial'>        
        
        
        <%  pulls the header from the page we are decorating and inserts it here   %>
        
    
    
        
            
                
            
            
                
                
                    <%   grabs the navigation.jsp page and decorates with the
                         panel decorator and puts it here   %>
                    
name="panel" />
                
                    
                        
                            
                        
                        
                            
                                
                                    <%  pulls the title from the page we are decorating
                                        and inserts it here   %>
                                    
                                
                            
                                <%  pulls the body from the page we are decorating and
                                    inserts it here   %>
Reusing a Common Page Layout with SiteMesh | 459
This is the Title of the Book, eMatter Edition
Copyright   2005 O'Reilly & Associates, Inc. All rights reserved.






footer




 

 

 

 

 Home | About Us | Network | Services | Support | FAQ | Control Panel | Order Online | Sitemap | Contact

strutsweb hosting

 

Visionwebhosting.net Business web hosting division of Web Design Plus. All rights reserved