Just having learned this last week, it's fresh in my mind.
Looks like you are missing the call to

this.saveErrors(errors);


this puts the ActionErrors into the request for your JSP
to display.

The other thing I'd say is that ActionErrors is deprecated;
you might use ActionMessages instead, which works EXACTLY
the same way. Then you would use

this.saveMessages(messages);


Good luck,

Mike


PS - not sure you need to get the MessageResources explicitly
 -- maybe that's used by other code further down your class?


> -----Original Message-----
> From: Scott Purcell [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, March 23, 2005 5:25 PM
> To: user@struts.apache.org
> Subject: Place message in jsp from action?
> 
> 
> Hello,
>  
> After I complete a successful Action, and I forward to my jsp 
> page, I would like to display a status ... something like 
> "New User Added".
>  
> Something that operates like the ActionErrors object. I tried 
> doing this in my Action class:
> ActionErrors errors = new ActionErrors();
>       // Get access to the message resources for this application
>       // There's not an easy way to access the resources from 
> an ActionForm
>       MessageResources resources =
>         (MessageResources)request.getAttribute( Action.MESSAGES_KEY );
>       // Check and see if the access number is missing
>       ActionError newError = new 
> ActionError("global.error.database.problem");
>       errors.add(ActionErrors.GLOBAL_ERROR, newError);
>  
> And then tried to pull the error out (just like an form 
> error), but the error never shows? 
> <html:errors />
>  
> I figured I am missing something, or possibly there is a 
> better way to handle this?
>  
> Thanks,
> Scott
>  
> 
> . 
>                                                  
> 
>  
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to