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

Who makes the struts?

886


Describe the mvc on struts?

913


What is the use of interceptor?

909


In which method of action class the business logic is executed?

927


Explain about logic match tag?

992


What is strut action mapping?

926


What is the difference in using Action interface and ActionSupport class for our action classes, which one you would prefer?

1087


Can you explain the directory structure for a struts folder in brief ?

910


What's mvc pattern ?

946


What is interceptor struts2?

931


Does struts include its own unit tests?

960


How to handle exceptions in structs?

1023


What is apache struts used for?

867


What is the use of form bean in struts?

870


Can I have html form property without associated getter and setter formbean methods?

951