I am bit confused with action errors; see AcrionErrors generally prepared by validate method,and in validate method i don't want to put any database check-up,for a case if user logs in to system and validate method passes all check like required,minlength etc. but for existance in to data base i have to check in the action and if user not found then i have to prepare actionerrors. so the question is how can i prepare actionerrors in action ? i am using 1.2.9 version (with netbeans 5.5) and if some one is thinking that solution is as bellow
ActionErrors ae = new ActionErrors( ); ae.add("userId", new ActionError("error.invalid.login")); request.setAttribute(Action.ERROR_KEY, ae);
it is not working , i think Action.ERROR_KEY is not present there. can any one help me ?
Thanks
Vijay Saraf.
vijay saraf
Ranch Hand
Joined: Jan 08, 2005
Posts: 141
posted
0
ya i myself found that key its Globals.ERROR_KEY.now working fine...
raj baig
Ranch Hand
Joined: Jul 11, 2006
Posts: 96
posted
0
hi vijay , all
great for sharing the information with all. i would like to know how to display the error massages . you stored the ActionErrors Object in request.
do we need to display in jsp. or the server will display.
Dom Lassy
Ranch Hand
Joined: May 05, 2006
Posts: 181
posted
0
<html:errors/> should do the trick.
raj baig
Ranch Hand
Joined: Jul 11, 2006
Posts: 96
posted
0
hi dom, Thank you for reply. i understood your reply. but i would like to know how the errors will display when an error occur in action class.