June 11th, 2003, 02:52 PM
How do I incorporate my error message jsp...
I'm very very new to JSP so please bear with me. I have a small .jsp file that displays a custom error page instead of the usual 404 500 type of server errors. What I am trying to figure out is how to incorporate it (call it) from say a main .jsp file....
Here is my error handling .jsp:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional??EN">
<%@page errorPage="show_error_page.jsp" %>
<%@page import= "java.util.Date" %>
<%-- Written by Mike 6/11/03 --%>
<head><title>EMail List Application</title></head>
<%@ page isErrorPage="true" %>
<p>There was a problem in adding your email to the list.
Please try again at a later time></p>
<p><i><%= exception %></i></p>
Today's date is <%= new Date() %> <br>
How would I "call" this when an error occurs in my main .jsp file
thanks very much
June 12th, 2003, 07:53 AM
You've made a small mistake. One your errorpage you should have something like <%@ page isErrorPage="true" %>, not <%@page errorPage="show_error_page.jsp" %>.
The <%@ page errorPage="show_error_page.jsp" %> line should go on your main.jsp. Then when an exception is thrown, show_error_page.jsp will be shown.
June 12th, 2003, 09:48 AM
Thanks very much............... will change it and give another shot
June 12th, 2003, 11:44 AM
If it doesn't work, let me know. I can always post a couple of example pages if it helps.