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 display data base errors on web console by using the
Struts Framework?

Answer Posted / m gangadhar

hi,
define a base class which handles all error related
operations. get Error code from E.getErrorCode() in Catch
block and then throw that error to action class.
Example.
Error code 00001: is defined for Unique constraint
voilation. for this
catch{
if(errorCode == 00001){
throw new UniqueKeyException();
}
}
// this unique exception is userdefined exception in my
framework.

and catch this exception in your action class. and be
remember in your struts-config file action tag define
input="/ErrorPage.do" property. then only it redirects to
that page in what u defined in input tag action path.

if any thing regarding this one feel free to mail me.
Thanks a lot

Is This Answer Correct ?    0 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What do you mean by a custom tag?

1000


what is ACID test for fresh engineers??what is the pattern??

2874


How the flow of various requests happens in struts application?

1045


What is switchaction?

1212


What is action chaining ?

1136


What kind of mvc is struts 2?

1064


What is actioncontext?

1004


What do you mean by the abstract package in struts2, and what is its utilization?

987


Explain the difference between dispatchaction and lookupdispatchaction in struts?

6400


how does request processor relates to action mapping?

959


How can we upload files in Struts2 application?

1077


What are the important methods of actionform?

1142


What are the core classes of struts framework? Explain

1063


Why is it called struts?

993


What is the purpose of @conversionerrorfieldvalidator annotation?

1257