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 the role of action class in struts?
How is token generated?
How is the mvc design pattern used in struts framework?
What’s the utilization of struts.xml configuration file?
How to explain Software Bank Loan descriptions
Give an alternative way to protect jsp’s with not much features from direct access.
In struts, how can we access java beans and their properties?
Is there a particularly good ide to use with struts?
What is defeult result type?
What is the purpose of form-be tag in struct-config.xml?
What does i18n interceptor?
Define struts?
Explain about logic match tag?
What are the core classes of struts framework? Explain
At the point, you should go for struts framework?