簡體   English   中英

jsp中的一些語法更改從struts1更改為struts2-> logic:messagesPresent

[英]Some syntax change in jsp from struts1 to struts2 --> logic:messagesPresent

我有下面的代碼。 如何處理logic:messagesPresent struts2 logic:messagesPresent ,用於檢查屬性並顯示<tld:label id="changepwd.error.info1" / >這是我的jsp標記庫,我認為它可以像我一樣保留在struts2中測試它可以顯示文本。

<logic:messagesPresent property="error.message.missingNewPassword">
        <tld:label id="changepwd.error.info1" />
</logic:messagesPresent>

logic:messagesPresent僅可用於Struts1.x。

您可以使用hasActionMessages()hasActionErrors()代替它,例如:

<s:if test="hasActionMessages()">
   <tld:label id="changepwd.error.info1" />
</s:if>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM