struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Geeta Ramani" <>
Subject RE: Confused about ActionMessages
Date Tue, 06 Jul 2004 18:44:37 GMT
Sorry Erik, prematurely hit some contrl key.. 

So, to continue, in your success.jsp add:

<logic:messagesPresent message="true">
       <html:messages id="message" message="true">
         <span id="success"><c:out value="${message}"/></span><br>

But to display your error, do:

    <span id="errorsHeader"><bean:message key="errors.validation.header"/></span>
    <html:messages id="error"  message="false">
      <li><strutsbean:write name="error" /></li>


> -----Original Message-----
> From: Erik Weber []
> Sent: Tuesday, July 06, 2004 2:45 PM
> To: Struts Users Mailing List
> Subject: Confused about ActionMessages
> Hello all.
> I have successfully used ActionErrors in combination with the 
> html:errors tag, by adding errors under various keys and then simply 
> placing the <html:errors/> tag at the top of my JSP.
> However, the ActionMessages class doesn't seem to act in 
> parallel to the 
> ActionErrors class, and neither does the html:messages tag 
> seem to act 
> just like the html:errors tag (for one, it has a required 
> attribute that 
> the docs don't explain very well). And I sure don't 
> understand all these 
> What's for what?
> Could someone please give me a quick and dirty example of using 
> ActionMessages to present a "Your data was saved" or similar 
> message on 
> the "success" page after a form action is processed?
> In other words, could you show me how you are populating the 
> ActionMessages instance in your Action class, and then how you are 
> displaying the messages on your JSP?
> You'll really be helping me out as I'm trying to show my client some 
> working pages soon! (I don't wanna cheat if I don't have to).
> Thanks,
> Erik
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message