Re: Nesting Decorators

Scott Farquhar <[email protected]> Fri, 15 Dec 2006 13:14:03 +0100
Newsgroups gmane.comp.web.sitemesh.general
Message-ID <[email protected]>
Leo,

The only way to do that is to use the <page:applyDecorator> tag for one 
of the decorators.  There are no ways to nest the decorators using 
decorators.xml.

Cheers,
Scott

Leo J. Hart IV wrote:
> Hello,
> 
> I'm wondering if Sitemesh supports nesting decorators.  I noticed two other posts asking about the availability of this functionality, but they didn't have any replies:
> 
> http://forums.opensymphony.com/click.jspa?searchID=373125&messageID=16613
> 
> http://forums.opensymphony.com/click.jspa?searchID=373125&messageID=15768
> 
> Basically, here's what I'm trying to do:
> 
> I have a decorator for ALL of my pages in my web app (DefaultDecorator.jsp).  It consists of a page header with menu items and a "content" section that includes the <decorator:body /> tag.  
> 
> I also have a decorator that I would use to wrap my JasperReports (DocumentDecorator.jsp). It's basically just a border.
> 
> The desired result would be that the <decorator:body /> tag of DocumentDecorator.jsp would be filled with the contents of the requested JasperReport.  The <decorator:body /> tag of the DefaultDecorator.jsp would then be filled with the DocumentDecorator.jsp (which already is filled with the JasperReport).  The report would be rendered complete with the border AND the header menu.
> 
> Here's my decorators.xml file:
> 
> <decorators defaultdir="/WEB-INF/jsp/decorators">
> 	<excludes>
> 		<pattern>/resources/*</pattern>
> 		<pattern>/styles/*</pattern>
> 		<pattern>/scripts/*</pattern>
> 	</excludes>
> 	<decorator name="default" page="DefaultDecorator.jsp">
> 		<pattern>/*</pattern>
> 	</decorator>
> 	<decorator name="document" page="DocumentDecorator.jsp">
> 		<pattern>/reports/JasperReports/Statement-Holdings.html</pattern>
> 	</decorator>
> </decorators>
> 
> Is this the correct way to do this or do I have to resort to using an include tag in my DocumentDecorator to include the DefaultDecorator?  That seems to defeat the purpose of sitemesh, so I'm assuming there's another way.
> 
> Thanks!
> Leo
> ---------------------------------------------------------------------
> Posted via Jive Forums
> http://forums.opensymphony.com/thread.jspa?threadID=52083&messageID=105101#105101
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]