在Struts.xml中,加上下一行代碼就可以了
<constant name="struts.ui.theme" value="simple" />
代表所有的頁面採用的都是 simple主題了,這時它輸出的頁面,不回添加任何多餘的代碼,比如 table tr td 等,我們就可以像其他編輯頁面的方式編輯頁面的風格。
或者 在 <s:form 中添加 theme
<s:form theme="simple"></s:form>
struts2每個標籤都有theme屬性
如果做了國際化之類有了struts.properties
我們可以修改struts.properties文件,添加
struts.ui.theme=simple
struts.ui.templateDir=template
struts.ui.templateSuffix=ftl
這樣比較規範