主题(theme)
//index.jsptheme测试<a href="theme.action">go</a>//theme.jsp在struts.xml中控制theme,默认为xhtml,可以设置为:simple/css_html/ajax<br/>要看页面源码<ol><li><s:form> <!-- formFieldError 默认带一个小点 --><div name="code">//struts.xml<constant name="struts.i18n.encoding" value="GBK" /> <!-- internationalization --><constant name="struts.ui.theme" value="css_xhtml" /><!-- <constant name="struts.ui.theme" value="mytheme" /> --><!-- 定义自己的主题 --><package name="theme" extends="struts-default" namespace="/"><action name="theme" name="code">//actionpackage com.bjsxt.struts2.theme;import com.opensymphony.xwork2.ActionSupport;@SuppressWarnings("serial")public class ThemeAction extends ActionSupport {public String execute() { //添加校验错误信息this.addFieldError("fielderror.test", "wrong!");return SUCCESS;}}