Hi, I know that in a JSP page you can just do: <% page errorPage="errorPage.jsp" %> But is there any way for me to map to this error page when an unforeseen error occurs in one of my servlets/class files instead of the server's "500 servlet exception page?" Thanks for any help
I am not sure..But try this and more probably it will work.. In Servlet or any other class, catch possible exception and redirect response to the error page that u desired.. Rgds Manohar
Joined: Jan 28, 2002
Thanks for your response, I'll work on that . . . I was hoping there might be some kind of special way to catch-all errors in servlets without having to explicitly write my own, but I haven't run across it in the books I've read.
In the calling JSP page use.. <%page errorPage="ErrorPage.jsp" import ... %> <% if (error) throw new Exception("message to be displayed") %> and in ErrorPage.jsp include the statements <%@ page isErrorPage="true"%> <%@ page import java.io.* %> <p> <%=exception.getMessage()%> Hope this would help Napa