This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Hi, Does anyone know of the servlet equilvalent to the JSP directive <%@ page errorpage = "someurl" %>? I need to catch any runtime exceptions any display a clean message. Putting try/catch blocks is not an option. We have about 500-600 class files and a change this late will be too critical.
"Putting try/catch blocks is not an option." Well you are not going to catch exceptions any other way, but you only need to have try/catch at the servlet doGet - doPost level. I generally enclose practically all the code in doGet or doPost in a try/catch - be sure to log the result as well as try to write a HTML page with the exception stack trace. Bill
"Al Coholic" ? A little too much Bart Simpson, I think, The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at http://www.javaranch.com/name.jsp . We require names to have at least two words, separated by a space, and strongly recommend that you use your full real name. Obviously fake names are not appropriate in a professional community such as this. Please log in with a new name which meets the requirements. Thanks.
Hi, According to the book "Core JSP" the <%@ page errorpage = "someurl" %> will deal with any uncaught exceptions. "This allows the JSP author to deal with any uncaught expcetions and present a nice looking front-end page to the client" This is how you would deal with exceptions without a try/catch clause. Does anyone know if there is a servlet equivalant?