File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to ActionErrors and ActionError" Watch "How to ActionErrors and ActionError" New topic

How to ActionErrors and ActionError


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
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 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

Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864

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.

Consultant, Sima Solutions
I agree. Here's the link:
subject: How to ActionErrors and ActionError
It's not a secret anymore!