Wiki source code of Struts2 Themes
Show last authors
author | version | line-number | content |
---|---|---|---|
1 | Struts2 provides four different themes: simple, xhtml, css_xhmtl and ajax. | ||
2 | |||
3 | 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.apache.org>>url:http://struts.apache.org/2.2.1/docs/struts-2-themes.html]]. | ||
4 | |||
5 | |||
6 | = Struts.xml - globally setting the theme to simple = | ||
7 | |||
8 | <?xml version="1.0" encoding="UTF-8"?> | ||
9 | <!DOCTYPE struts PUBLIC | ||
10 | "-~/~/Apache Software Foundation~/~/DTD Struts Configuration 2.0~/~/EN" | ||
11 | "http:~/~/struts.apache.org/dtds/struts-2.0.dtd"> | ||
12 | \\<struts> | ||
13 | <constant name="struts.ui.theme" value="simple" /> | ||
14 | </struts> |