Submitted by: siva kumar reddy
hi,
to handle the errors:
in struts project to handle the error objet by using ActionError object and to handle the errors by using ActionErrors object.
for suppose
ActionError ae1=new ActionError("err.one");
ActionError ae2=new ActionError("err.two");
Action Errors aes=new ActionErrors();
aes.add(ae1);
aes.add(ae2);
saveErrors(request,aes);//store the errors object in request object
to handle exception:
1)using try and cach blocks
2)using declarative exception handling technique
to handle the exceptions by using global exceptons tag in struts-config.xml
<global-exceptions>
<exception key="gen.err" type="java.lang.ClassNotFoundException" path="/gen.jsp"/>
whenever that exception will be came it executes the gen.jsp page.
cheers
siva
Above answer was rated as good by the following members:
pradeepkmr18