How display data base errors on web console by using the
Struts Framework?
Answers were Sorted based on User's Feedback
Answer / ranjith nambiar
In hibernate configuration file, hibernate.cfg.xml, with in <session-factory> put <property name="show_sql">true</property>.
| Is This Answer Correct ? | 1 Yes | 2 No |
Answer / 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 |
What is actioninvocation?
What are the features of struts?
i have list of values(e.g 100). using logic:iterate, how can i print the multiples of 5th element? how the logic:iterate will understand the multiples of 5.
What are the Core classes of Struts Framework?
What is pojo in struts2?
Where can i get jar file for use the struts-tags in struts2?
Explain how to work with error tags?
What is the purpose of @before annotation?
What does i18n interceptor?
Which class of struts is responsible to converts data types from string and vice versa?
How do you customize ActionServlet?
what is the use of cvs in struts?