其實struts標簽是不能夠嵌套的;
例一:<logic:iterate id="cl" name="Ids"> //循环取得id
//比较beanname中的id是否和cl中的id相同,如果相同就显示cl中的name
//比较beanname中的id是否和cl中的id相同,如果相同就显示cl中的name
<logic:equal name="beanname" property="id"
value="<bean:write name="cl" property="id"/>">
<bean:write name="cl" property="name"/>
</logic:equal>
</logic:iterate>
<bean:write name="cl" property="name"/>
</logic:equal>
</logic:iterate>
紅色文字區就是錯誤的嵌套了,這樣是得不到想要的結果的,可改爲
<logic:iterate id="cl" name="Ids"> //循环取得id
<bean:define id="temId" name="cl" property="id" type="java.lang.String"/>
<bean:define id="temId" name="cl" property="id" type="java.lang.String"/>
//比较beanname中的id是否和cl中的id相同,如果相同就显示cl中的name
<logic:equal name="beanname" property="id" value="<%=temId%>">
<bean:write name="cl" property="name"/>
</logic:equal>
</logic:iterate>
<logic:equal name="beanname" property="id" value="<%=temId%>">
<bean:write name="cl" property="name"/>
</logic:equal>
</logic:iterate>
這樣先定義,后使用,就ok了。
例二:<html:submit value="<bean:message key="welcome.login" bundle="base"/>"/>
應該為
<html:submit>
<bean:message key = "welcome.logon" bundle = "base"/>
</html:submit>
<bean:message key = "welcome.logon" bundle = "base"/>
</html:submit>