File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Struts: ActionMessage vs. Action Error Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Frameworks » Struts
Reply Bookmark "Struts: ActionMessage vs. Action Error" Watch "Struts: ActionMessage vs. Action Error" New topic
Author

Struts: ActionMessage vs. Action Error

Jessica Doe
Ranch Hand

Joined: Dec 11, 2003
Posts: 32
I read in one book that ActionError is being deprecated in favor of ActionMessage. Another book mentions nothing of this. Is it so? Should I convert my ActionErrors to ActionMessages?

Can you put an Action Error in ActionMessages? If so, how do you pull only errors or messages out?

Thanks,

Jess


Jessica Doe<br /> <br />C# Online.NET<br /> <a href="http://wiki.csharp-online.net/" target="_blank" rel="nofollow">http://wiki.csharp-online.net/</a>
Shankar Narayana
Ranch Hand

Joined: Jan 08, 2003
Posts: 134
I read in one book that ActionError is being deprecated in favor of ActionMessage. Another book mentions nothing of this. Is it so? Should I convert my ActionErrors to ActionMessages?

Can you put an Action Error in ActionMessages? If so, how do you pull only errors or messages out?

Thanks,

Jess


Hi,

It is true that 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.



and to access this errors in the jsp page use this code



Cheers


"Failure is not when you fall down; its only when you fail to get up again."
Jessica Doe
Ranch Hand

Joined: Dec 11, 2003
Posts: 32
Thanks!
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Struts: ActionMessage vs. Action Error
 
Similar Threads
ActionMessage not iterating
Question about html:messages
ActionMessages?????????
Struts framework
using two properties files in struts