This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Struts and the fly likes How to ActionErrors and ActionError Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to ActionErrors and ActionError" Watch "How to ActionErrors and ActionError" New topic
Author

How to ActionErrors and ActionError

Gopnan
Greenhorn

Joined: Sep 13, 2007
Posts: 15
Hi Firends,
I am new to struts application. I don't know what is use ActionErrors and ActionError and how to use this Errors in our Struts application .Anybody help to me. Give a sample code for how to use this.
John Melton
Ranch Hand

Joined: Aug 17, 2004
Posts: 49
Hi,
ActionErrors is just a way to do validation and get errors onto the JSP page for display. For the most part now you can use ActionMessages instead of ActionErrors. Here's a simple example. From your action, write these lines:



In the ApplicationResources.properties file (your messages file), you'd have to put a message in for "my.error.something", or whatever you called your error, then on the jsp page, use thes lines



[url]www.jtmelton.com[/url]
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Gopnan,

Please change the publicly displayed name on your profile so that it conforms to the JavaRanch Naming Policy.

Failure to do so may result in your profile being removed.


Merrill
Consultant, Sima Solutions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to ActionErrors and ActionError