Apache Struts 2 Documentation > Home > FAQs > Can I change templateDir on a per-page basis |
The default template directory is passed to the page through a templateDir variable. To change the template dirctory for a page, use the set tag to change the templateDir variable. The variable can be changed using a static value or property.
Change to the "template" directory.
<saf:set name="templateDir" value="template" scope="page" />
Change to the theme name indicated by the myTemplateDir property.
<saf:set name="theme" value="%{myTemplateDir}" scope="page" />
See also Template Loading