Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

How exception handling is provided in struts?

Answer Posted / sitaram

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.

Is This Answer Correct ?    12 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is difference between actionform and dynaactionform?

1030


Explain the life cycle of a request in struct2 application?

898


What is the differences between struts1 and struts2?

928


how to debug struts project in netbean ?

2352


How struts control data flow?

1096


Why do the struts tags provide for so little formatting?

967


How is a lookup dispatch action created?

995


How you will make available any message resources definitions file to the struts framework environment?

969


Where can I get help with struts?

988


Which design pattern the interceptors in struts2 is based on?

911


What is struts and why it is used?

955


Which technologies can be used at view layer in struts?

1077


What are the important methods of actionform?

1074


What is the use of execAndWait interceptor?

1028


How the exceptions are handled in struts?

988