OK, I have been racking my brain on how to do this, I have searched high and low and I haven't found a solution to the problem. Is there a way with Tomcat to set up a custom error page when something goes wrong on a page? I can't seem to find anything on this or how to do it. Thanks in advance. Matt
That functionality is built in to the JSP spec. In your page directive you set an errorPage url with the (SURPRISE!) errorPage attribute. That URL points to a JSP page that has the attribute isErrorPage="true" On that page you will have an automatic object named (SURPRISE!) exception. You can then output a stack trace or otherwise pull diagnostic information out of the exception thrown by your page.... This is all discussed in the JSP API documentation. Any decent servlets and JSP book would have an example. Bill ------------------ author of:
Great, but that doesn't solve the problem unless you add that tag in every page of the application. The application that we are developing has hundred of pages. Tomcat can't just have a setting in the config that will allow all errors to point to a specific page even if it doesn't have the error page set? Matt P.S. Not sure if the sarcasm is warrented here. I am sure that you have been a Java pro your entire life and never needed to ask for help. Very uncool.
If your application is packaged in a WAR file (Web Application) you can specify error pages in your web.xml (this way you can cover ALL the pages in your app, plus its not tied to one particular app server): From the Servlet 2.2 spec web.xml -->