JavaScud | Forum | JIRA | Blog |
  Dashboard > WebWork2文档中文化计划 > ... > FAQ > Can I change templateDir on a per-page basis
  WebWork2文档中文化计划 Log In View a printable version of the current page.  
  Can I change templateDir on a per-page basis
Added by scud, last edited by scud on Mar 30, 2006  (view change)
Labels: 
(None)

Yes, by using the <ww:set name="templateDir" value="myTemplateDir" scope="page" />.

This will set the attribute 'templateDir' in the page scope, with the value of what that is returned by 'myTemplateDir' in the stack, eg. the action class might have a getMyTheme method that return a String called template, to indicate what the template directory is within the classpath.

Another way would be <ww:set name="templateDir" value="'template'" scope="page" />

This will set the attribute 'templateDir' in the page scope with the value 'template' to indicate what the template directory is within the classpath.

See Template Loading

Site running on a free Atlassian Confluence Open Source Project License granted to WebWork China. Evaluate Confluence today.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.5.3 Build:#808 May 29, 2007) - Bug/feature request - Contact Administrators