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 ActionErrors from Action Class are not displaying in struts jsp page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "ActionErrors from Action Class are not displaying in struts jsp page" Watch "ActionErrors from Action Class are not displaying in struts jsp page" New topic
Author

ActionErrors from Action Class are not displaying in struts jsp page

vamsi mummadi
Greenhorn

Joined: Jul 25, 2006
Posts: 9
hi
Iam facing problem while displaying ActionError messages.
Error messages from ActionForm validate method are displaying properly but from Action class iam creating some errors those things are not displaying in my Jsp page.
Iam sending my code please try to solve my problem

code:
in Action class

errors.add("MOU Number",new ActionError("errors.notavailable",mou_no));

if(!errors.isEmpty())
{
saveErrors(req,errors);
}

in Application Resources

errors.notavailable=MOU Number {0} is already exist in the Data Base.

in Jsp page iam displaying these errors by
<html:errors/> tag

and in my struts-config.xml iam setting validate and input attributes.

Iam not getting where i made mistake ActionForm validate method case is working fine but this case is not working

Please Help me


vamsi
sai kinnera
Ranch Hand

Joined: Aug 12, 2004
Posts: 52
Try
errors.add(ActionErrors.GLOBAL_ERROR,new ActionError("errors.notavailable",mou_no));

in the action class
vamsi mummadi
Greenhorn

Joined: Jul 25, 2006
Posts: 9
I tried that still iam not getting the error message in jsp. but errors are adding into that ActionErrors object but iam not getting why they are not displaying.
please help me
sai kinnera
Ranch Hand

Joined: Aug 12, 2004
Posts: 52
Then it's a problem with your ApplicationResources file, where you have your error messages. Could be a configuration issue. The application is not reading the error messages.
Brent Sterling
Ranch Hand

Joined: Feb 08, 2006
Posts: 948
hmmm...looks pretty good to me. Also, I think if your forward has redirect set to true, you will loose the error messages. That might be worth checking.

- Brent
vamsi mummadi
Greenhorn

Joined: Jul 25, 2006
Posts: 9
Thank you its working i set redirect to false then iam getting those error messages.
thank you very much
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ActionErrors from Action Class are not displaying in struts jsp page