Selecting Themes
Themes can be selected using several different rules, in this order:
- The
themeattribute on the specific tag - The
themeattribute on a tag’s surrounding form tag - The page-scoped attribute named
theme - The request-scoped attribute named
theme - The session-scoped attribute named
theme - The application-scoped attribute named
theme - The
struts.ui.themescoped constant of the action’s package or one of its parents (since 7.5.0) - The
struts.ui.themeproperty instruts.xml(defaults to xhtml)
See Can I change theme on a per-page basis page for using scoped theme attribute.
Tips
- To override an entire form’s theme, change the “theme” attribute of the form. (Convenient for using the ajax theme for specific forms, for example.)
- To support user-selected themes, set the theme in the user’s session.
- To change the theme for all actions of a package, declare
<scoped-constant name="struts.ui.theme" value="css_xhtml"/>in that package (since 7.5.0). - To change the theme for the entire application, modify the
struts.xml.