struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Geeta Ramani" <gram...@terralink.com>
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>
       </html:messages>
</logic:messagesPresent>

But to display your error, do:

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

Hth,
Geeta


> -----Original Message-----
> From: Erik Weber [mailto:erikweber@mindspring.com]
> 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 
> constants (GLOBAL_ERROR, ERROR_KEY, MESSAGE, ACTION_MESSAGE, etc). 
> 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: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message