Sundar
Answered On : Mar 22nd, 2005
The difference between the classes is zero -- all behavior in ActionErrors was pushed up into ActionMessages and all behavior in ActionError was pushed up into ActionMessage. This was done in the attempt to clearly signal that these classes can be used to pass any kind of messages from the controller to the view -- errors being only one kind of message
Login to rate this answer.
Vinay Kumar Samudrala
Answered On : Oct 4th, 2005
Hi Friends,
ActionErrors and ActionMessages are same but in the struts-config.xml file if you are given the input in action tag and If action errors object is not empty it will goes to that input defined path.
But if your ActionMessages object is null or it contains the value it will goes to forwarded action only. ActionMessages are used to display the warnings
regards
Vinay Kumar Samudrala
Hyderabad

1 User has rated as useful.
Login to rate this answer.
bangaram
Answered On : Apr 26th, 2006
ActionMessages is the super class of ActionErrors.

1 User has rated as useful.
Login to rate this answer.
siva kumar reddy
Answered On : Aug 4th, 2006
in struts 1.0 to dispaly the errors, ActionError was used but struts1.1 that feature depricated by ActionMessage tag.
it will be generated like
main advantage of ActionMmessage tag is it does not force to write html tags in properties file .but ActionError object forces to write html tags.
cheers
siva

2 Users have rated as useful.
Login to rate this answer.
vijayaraja
Answered On : Apr 20th, 2007
Its a superset of ActionErrors
Login to rate this answer.
kamala
Answered On : Apr 22nd, 2007
There isno difference between action errors and action Messages both working for same usage that is displaying error messages to the client
Login to rate this answer.
sasikumar`
Answered On : May 31st, 2007
Action Message :
Encapsulate the collection of message,these messgae are global, each message specified the perticular bean property, these are contain the key, whichis refer the resourse bundle in database.
Action Error :This is a return type of the validate(),contain the collection of error messages, these messgae are reported by the validate() of the Action form
these message are global and represent the perticular bean property,
Login to rate this answer.
kuldeep kaushik
Answered On : Jul 13th, 2007
The ActionErrors object is basically a collection class for storing org.apache.struts.action.ActionMessage instances.
Login to rate this answer.
charuta
Answered On : Aug 3rd, 2007
The difference between Struts 1.1 and Struts 1.2 isDeprecation of ActionError class. (Use ActionMessage instead)
Login to rate this answer.
jameel khan
Answered On : Sep 1st, 2007
The difference between ActionErrors and ActionMessage is not more except that ActionError is depricated. Firstly came struts had theActionErrors, but that is the confusing because Error means only problem but while it revealed new version then gave the name is ActionMessage. In this we can give all the type of message like info message, warn messageerror message, fatal error message.

2 Users have rated as useful.
Login to rate this answer.
sita
Answered On : Oct 25th, 2007
There is no specific difference between action messages and action errors. Both having the same functionality, displaying the error messages.
Login to rate this answer.
shilpa
Answered On : Oct 25th, 2007
A class that encapsulates the error messages being reported by the validate()method of an ActionForm. A class that encapsulates messages. Messages can be either global or they are specific to a particular bean property
Login to rate this answer.
Amandeep
Answered On : Nov 11th, 2007
There is not much difference. Both work for reporting error messages..It is the superset of Error classes.
Login to rate this answer.
PS:This is w.r.t Struts 1.3
There is no difference between ActionErrors and ActionMessages.
ActionErrors extends ActionMessages which means ActionMessages is a type of ActionErrors.
ActionErrors doesnt have any other methods other than the constructor(s).
1. RequestProcessor invokes validate() on ActionForm.
2. ActionErrors is a return type of validate() method in ActionForm.
3. If ActionErrors object is not empty, the RequestProcessor forwards to the path
based on "input" attribute and doesnot invoke execute().
4. If ActionErrors object is empty, the execute() of Action class is invoked and
the RequestProcessor forwards to the path specified in the "forward" of Struts-config.xml
Login to rate this answer.
Hi, actually there is no difference between these two. Struts 1.1 used ActionErros and Struts 1.2 is using ActionMessages.
ActionError is being deprecated in favour of ActionMessage, unfortunately the validate method of ActionForm still returns the ActionError object, so to work around it what you can do is instead of putting the ActionErrors objects into ActionErrors, put the ActionMessage objects.
- ActionErrors actionErrors = new ActionErrors();
- actionErrors.add("CompanyName",new ActionMessage
- (ErrorConstants.ERROR_REQUIRED,"Company Name"));
- actionErrors.add("Phone No", new ActionMessage
- (ErrorConstants.ERROR_REQUIRED,"Phone No"));
ActionErrors actionErrors = new ActionErrors(); actionErrors.add("CompanyName",new ActionMessage (ErrorConstants.ERROR_REQUIRED,"Company Name")); actionErrors.add("Phone No", new ActionMessage (ErrorConstants.ERROR_REQUIRED,"Phone No")); and to access this errors in the jsp page use this code
- <html:messages id="msg" message="false" >
- <bean:write name="msg"/>
- </html:messages>
Login to rate this answer.
Action Errors(org.apache.struts.action.ActionErrors): A class that encapsulates the error messages being reported by the validate() method of an ActionForm. Validation errors are either global to the entire ActionForm bean they are associated with, or they are specific to a particular bean property (and, therefore, a particular input field on the corresponding form). Each individual error is described by an ActionMessage object, which contains a message key (to be looked up in an appropriate message resources database), and up to four placeholder arguments used for parametric substitution in the resulting message.
ActionMessage(org.apache.struts.action.ActionMessage): An encapsulation of an individual message returned by the validate method of an ActionForm, consisting of a message key (to be used to look up message text in an appropriate message resources database) plus up to four placeholder objects that can be used for parametric replacement in the message text
Yusaf here
Login to rate this answer.