File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes ActionErrors vs ActionMessages Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "ActionErrors vs ActionMessages" Watch "ActionErrors vs ActionMessages" New topic

ActionErrors vs ActionMessages

amit sanghai
Ranch Hand

Joined: Dec 05, 2000
Posts: 231

I am not sure why ActionMessages are used when we can use ActionErrors. Can someone please help.

Thanks and regards,
Adam Kreiss
Ranch Hand

Joined: Sep 12, 2005
Posts: 35
ActionErrors are used to display a single kind of message, an error message.

ActionMessages allow you to have other types of messages such as confirmation messages, completion messages, etc. in addition to the error messages.
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
If you are using Struts 1.2, ActionErrors is deprcated and you should always use ActionMessages. If you are using Struts 1.1, use ActionMessages for informational messages and ActionErrors for error messages.

Consultant, Sima Solutions
bryan nelson
Ranch Hand

Joined: Jun 16, 2003
Posts: 95

I'm working with a Struts 1.1 app...but it may be upgraded to 1.3 in the near future. In this case would it be wise to just use the ActionMessages all the time for future compatibility?


"...and the Truth will set you free."
I agree. Here's the link:
subject: ActionErrors vs ActionMessages
It's not a secret anymore!