"Brian K. Buckley" wrote:
> Yes but how do I access that errors object from the perform() method of
> Action?  (or if we create a new ActionErrors object, where do we put it
> since perform() returns an ActionForward object, not an ActionErrors
> object).
> 
> I wanted to be able to add the errors in the perform() method of my action
> object so that when the perform method returned for example,
> "mapping.findForward("failure")", the appropriate errors messages get
> displayed with the <html:errors/> tag in the jsp.
> 
> -Brian

The errors object is saved in the request under a known key
(Action.ERRORS_KEY).

Within perform(), you can call the convenience method 

saveErrors(javax.servlet.http.HttpServletRequest request,
                ActionErrors errors) 

to do this. See the JavaDoc for more about how the Action class works. 

http://jakarta.apache.org/struts/api/org/apache/struts/action/Action.html

It's a good read, really ;-)


-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel +1 716 737-3463
-- http://www.husted.com/about/struts/

Reply via email to