How to use SessionDecorator ?

Ricardo Lecheta <[email protected]> Wed, 20 Apr 2005 13:59:55 CDT
Newsgroups gmane.comp.web.sitemesh.general
Message-ID <15247643.1114023625838.JavaMail.os-j2ee@opensymphony01.contegix.com>
Hi,


The SessionDecoratorMapper will look at a session attribute to find the name of an appropriate decorator to use. If the session attribute is present, the mapper will not do anything and allow the next mapper in the chain to select a decorator.

Cofigure the SessionDecoratorMapper in sitemesh.xml:
<mapper class= "com.opensymphony.module.sitemesh.mapper.SessionDecoratorMapper">
  <param name="decorator.parameter" value="decorator" />
</mapper> 

Configure decorators.xml:
<decorator name="decoratorA" page="decoratorA.ftl" />
<decorator name="decoratorB" page="decoratorB.ftl" />
<decorator name="decoratorC" page="decoratorC.ftl" />

Now you set the  'decorator' session attribute, and sitemesh you use the correct page.

For example:
session.setAttribute("decorator","decoratorB"),
so sitemesh will use the decoratorB.ftl page...

Hope it helps,
Ricardo

hi
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=1706&messageID=5255#5255


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