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 is the purpose of redirect result type?

1020


What is the difference between shocks and struts?

956


How to display validation errors on jsp page?

1020


Who makes the struts?

948


What does the term struts mean?

990


What design patterns are used in struts?

1012


What is apache struts cve 2017 5638?

977


What is the procedure of operation of a form tag?

963


What is difference between struts1 and struts2?

922


What is the use of web xml in struts2?

910


Why we use struts over servlets?

1071


Can we handle exceptions in Struts programmatically?

976


Explain the difference between dispatchaction and lookupdispatchaction in struts?

6361


What’s the difference between struts and turbine? What’s the difference between struts and espresso?

989


What does it cost to replace struts?

970