struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Geeta Ramani" <gram...@terralink.com>
Subject RE: ActionError(s) vs. ActionMessage(s)
Date Fri, 18 Jun 2004 14:49:28 GMT
uh, oh, never mind. major duh moment.. The answer is right there in the first link:

Finally, you can save an [ActionMessages] object under an arbitrary key and display it with
the html:messages tag:

  ActionMessages am = new ActionMessages();
   am.add( ActionMessages.GLOBAL_MESSAGE, 
           new ActionMessage( "msg.warning" ) );
  request.setAttribute("warnings", am);

and in your page:

   <html-el:messages name="warnings" id="msg">
      <c:out value="${msg}"/>
   </html-el:messages>

Sorry for wasting your time!
Geeta

> -----Original Message-----
> From: Geeta Ramani 
> Sent: Friday, June 18, 2004 10:44 AM
> To: Struts Users Mailing List
> Subject: ActionError(s) vs. ActionMessage(s)
> 
> 
> Hi all:
> 
> I have been looking into ActionErrors vs. ActionMessages and 
> found the following two links:
> 
> http://nagoya.apache.org/wiki/apachewiki.cgi?StrutsDeprecatedA
> ctionErrors
> 
> and
> 
> http://www.husted.com/struts/tips/017.html
> 
> The first link suggests that ActionError will be deprecated 
> starting 1.2. However, ActionForm.validate will still return 
> ActionErrors. So how is one supposed to use validate()? (It's 
> easy enough to create ActionMessages in the ActionForm but 
> the saveMessages method is only part of the Action class not 
> the ActionForm..) 
> 
> Finally, the latter part of the second link above does still 
> seem to use ActionError and ActionErrors.. I know I must be 
> missing something.. ?
> 
> Thanks for your time!
> Regards,
> Geeta
> 
> ---------------------------------------------------------------------
> 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