I have two namespaces,  "admin" and " (the default namespace).  I'd like to 
re-use the same result template for both, but decorate them differently.

My templates declare their decorator using the meta tag, like this: <meta 
name="decorator" content="admin" />
Then, in decorators.xml, I have defined:     <decorator name="admin" 
page="admin.ftl" />

I'd like to generalize this to have one decorator per namespace, and remove the 
meta tag in my files.  How can I get DecoratorMapper to be namespace aware?  
Should I write my own NamespaceDecoratorMapper extends AbstractDecoratorMapper? 
 How would the DecoratorMapper get access to the ServletActionContext?

Alternately, I could keep my current system and simply use <meta 
name="decorator" content="${namespace}" /> in my result templates, then 
implement my BaseAction's getNamespace as:

String getNamespace() {
  return ServletActionContext.getActionMapping().getNamespace();
}

What do you guys think?  Has anyone implemented namespace-specific sitemesh 
decorators before?

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org

Reply via email to