tags:

views:

306

answers:

1

I am using Struts 1.3.10. I am trying to display ActionMessage and ActionError set by Action class through a JSP page.

The problem is that the ActionErrors are displaying well but ActionMessages are not displaying. When I debug the application, I found that the messages (reference variable of ActionMessages) contains messages. I also saved those messages through saveMessages(request, messages) method of Action class.

So, I think that the problem is in the JSP code through which I am trying to display those messages. The JSP code is as follows:

<logic:messagesPresent>
    <ul id="messsages">
        <html:messages id="msg" message="true">
            <li><bean:write name="msg"/> </li>
        </html:messages>
    </ul>
</logic:messagesPresent>
A: 

I forgot to add attribute message="true to the<logic> tag. By default, the value of message attribute is false.

The <logic> tag should look like

<logic:messagesPresent message="true">
Yatendra Goel
Thanks for entering the answer :)
Daniel Melo
You've asked similar questions like this before and I've helped. Nice to see you've figured it out.
The Elite Gentleman