Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problem getting ActionError to display properly

Status
Not open for further replies.

plambert

Programmer
Jul 10, 2003
2
US
Would someone kindly clear my confusion? I have overridden the

validate(ActionMapping mapping, HttpServletRequest request)

method in my ActionForm and have successfully gotten it to check the items in my Form bean. However after having

ActionErrors errors = new ActionErrors();

errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("myText"));
errors.add("test",new ActionError("myText"));

The jsp page I return to shows "Validation Error(s)" with a horizontal line below but none of my text appears.

What am I doing wrong??

Thanks in advance!
 
Figured it out. I didn't realize that the item that I specified in quotes in the ActionError constructor had to be a reference to an entry in my application.resources file. I thought I could simply put in anything and it would display what I put in. The 'anything' would need to be in a second (or third...) argument in the constructor and the reference in my application.resources file would need to look for those other entries by using {0}, {1}, etc for each item I wanted to add in the constructor.

Hope this helps someone :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top