程序中寫 this.addFieldError("desc","desc is error");
jsp頁面:
<s:fielderror fieldName="desc" theme="simple"/>
<s:propery value="errors.name[0]"/>
以上2者的區別<s:fielderror fieldName="desc"/> 有自己的顯示方式--------》 查看源碼
Struct2標籤:
要使用標籤時必須<%@taglib uri="/struts-tags" prefix="s"%>
"/struts-tags在jar 包裏面 :struts-tags.tld
<s:debug></debug>
s:property 取value stack和context中的值