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 struts validator framework?

541


What are inner class and anonymous class?

541


What are different ways to create Action classes in Struts2?

583


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

512


How can we group related actions in one group in Struts?

555






What are the contents on web.xml in struts application ?

503


Can you explain struts.properties in struts2?

521


Is Struts Framework part of J2EE?

607


How does struts2 token work?

518


Are the struts tags xhtml compliant ?

533


Which file is used by controller to get mapping information for request routing?

527


how does request processor relates to action mapping?

480


Explain the difference between jakarta struts and apache struts?

512


How to work with error tags?

553


What is the forward action utilized for?

546