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
What is struts validator framework?
What are inner class and anonymous class?
What are different ways to create Action classes in Struts2?
What’s the difference between struts and turbine? What’s the difference between struts and espresso?
How can we group related actions in one group in Struts?
What are the contents on web.xml in struts application ?
Can you explain struts.properties in struts2?
Is Struts Framework part of J2EE?
How does struts2 token work?
Are the struts tags xhtml compliant ?
Which file is used by controller to get mapping information for request routing?
how does request processor relates to action mapping?
Explain the difference between jakarta struts and apache struts?
How to work with error tags?
What is the forward action utilized for?