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

Is struts action class singleton?

947


How many struts config file can be created in struts?

849


What are the differences between Struts1 and Struts2 or how Struts2 is better than Struts1?

961


How many struts config file in a struts application?

872


What is use of i18n interceptor?

942


What are the main classes which are used in struts application?

932


What does it cost to replace struts?

923


What is token used for?

885


What is the use of Struts.xml configuration file?

889


What is controller in struts ?

939


What is the purpose of @key?

988


What are the benefits of Interceptors in Struts2?

1116


What are the benefits of Struts framework?

959


If the framework doesn’t do what I want, can I request that a feature be added?

898


How to use dispatchaction?

991