Hi. I have been checking PetClinic example of Spring framework in order to know how to handle exceptions in Spring&Hibernate&Web-based interface. The example throughs DataAccessException which is a sucbclass of RuntimeException. When an exception accured at Hibernate level, a stack trace web page is displayed. This is not what I want to do -I can't let the user see this page, it is unfriendly-. So, how to handle data access exceptions in Spring&Hibernate&Web interface ? Thanks.
What are you using at the web layer? If using struts, you can define an a general exception handler for dataaccessexception. And for specific cases of data access exception, you might want to catch them in the Action layer and render differently.
Sab<br /> <br />Perfection does not come from belief or faith. Talk does not count for anything. Parrots can do that. Perfection comes through selfless work.<br />Swami Vivekananda
I'm THIS CLOSE to ruling the world! Right after reading this tiny ad: