how do I catch errors globally, log them and show user an error page in J2EE app
I have searched this topic on google a bit and seen some best practices. But I need some specific advice. I am working on a J2EE app that has servlets/Struts2/Call to DAO's from JSP's. So the app is all kinds of messed up. Most of the data is fetched via stored procedures, which are being called by iBatis ORM/Spring. Sometimes when an error happens on the SP side it will display an ugly message to the user such as below: javax.servlet.ServletException: org.springframework.jdbc.BadSqlGrammarException: SqlMapClient operation; bad SQL grammar []; nested exception is com.ibatis.common.jdbc