gpt4 book ai didi

java - jsp 中从 struts1 到 struts2 的一些语法更改 --> 逻辑 :messagesPresent

转载 作者:行者123 更新时间:2023-12-02 02:40:19 30 4
gpt4 key购买 nike

我有以下代码。 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/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com