Re: How to disable any decorators from Java?

Scott Farquhar <[email protected]> Thu, 1 Sep 2005 19:21:16 +1000
Newsgroups gmane.comp.web.sitemesh.general,gmane.comp.lang.pnuts.user
Message-ID <[email protected]>
Peter,

On Mon, Aug 29, 2005 at 05:05:10PM -0500, Peter wrote:
> 1) the jsp goes to MyAction.red, which is a Struts action, which should apply the decorator "red" in most of the cases
> 
> 2) in MyAction.java (a Struts Action), sometimes (depending on the logic), I want to tell SiteMesh not to apply *any* decorators, so just give me the forwarded jsp as is
> 
> 3) so most of the time I want "red" to be applied, but in some rare cases I don't want anything to be applied.
> 
> I need to tell this to SiteMesh from Java.  I don't think I can put an empty String into request under the key com.opensymphony.module.sitemesh.RequestConstants.DECORATOR.  I believe I tried that and it gave me an error like "Cannot find decorator '' in any......."

In the JSP view, you can use meta tags to control which decorator you
want to apply.

If you use the tag (in the head of the page):

  <meta name="decorator" content="red" />

To pick the 'red' decorator, or 

  <meta name="decorator" content="none" />

To pick a decorator that doesn't exist (effectively no decorator).


Cheers,
Scott 

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