我有以下代码。 logic:messagesPresent
在struts2中如何处理用于检查属性并显示 <tld:label id="changepwd.error.info1" /
>这是我的jsp标签库,我认为它可以保留在struts2中,因为我已经测试过它可以显示文本。
<logic:messagesPresent property="error.message.missingNewPassword">
<tld:label id="changepwd.error.info1" />
</logic:messagesPresent>
最佳答案
logic:messagesPresent
只能使用 Struts 1.x。
您可以使用 hasActionMessages()
或 hasActionErrors()
代替它,例如:
<s:if test="hasActionMessages()">
<tld:label id="changepwd.error.info1" />
</s:if>
关于java - jsp 中从 struts1 到 struts2 的一些语法更改 --> 逻辑 :messagesPresent,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45603315/