Struts2 Themes

Last modified by Ken McWilliams on 2012/03/10 02:20

Struts2 provides four different themes: simple, xhtml, css_xhmtl and ajax.

In all my projects I use the simple theme which behaves exactly the way we would expect regular html to behave. Since we are all web developers and know html/css the simple theme provides the least astonishment.  Because I want this theme to apply to my whole application I simply set this value in my struts.xml.  The default theme can be set for a specific tag, the page being rendered, the whole request, session or even globally.  For more detail on themes visit

Struts.xml - globally setting the theme to simple

<?xml version="1.0" encoding="UTF-8"?>
    "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"

    <constant name="struts.ui.theme" value="simple" />

This wiki is licensed under a Creative Commons 2.0 license
XWiki Enterprise 15.0 - Documentation