AMMA
AMMA

Reputation: 111

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

I have below code. How to handle in struts2 of logic:messagesPresent which is for checking the property and display the <tld:label id="changepwd.error.info1" /> which is my jsp tag library and I think it can remain in struts2 as I have tested it can show the text.

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

Upvotes: 0

Views: 1220

Answers (1)

Kohei TAMURA
Kohei TAMURA

Reputation: 5122

logic:messagesPresent can be used only Struts 1.x.

You can use hasActionMessages() or hasActionErrors() instead of it, for example:

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

Upvotes: 2

Related Questions