struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Weber <erikwe...@mindspring.com>
Subject Re: Confused about ActionMessages
Date Tue, 06 Jul 2004 20:05:50 GMT
Thank you Geeta, I will give this a try.

If anyone could shed some light on exactly what these tags are doing 
under the covers (especially what attribute keys are used by default, 
how to change those, when should you, etc.), I would appreciate it. 
Otherwise, I guess I'll get into the source when I have time.

Erik


Geeta Ramani wrote:

>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
>
>
>  
>

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


Mime
View raw message