TCLUG Development Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Simple error page in jsp



I am using tomcat 3.1 and trying to get a simple jsp error page to work.

I have my 'main' jsp file with this:

<%@ page isThreadSafe="false"
    import="bob.Test" 
    errorPage="ErrorPage.jsp"
%>

<jsp:useBean id="test" scope="session" class="bob.Test" />
<jsp:setProperty name="test" property="*" />

<html>
<head><title>Testing</title></head>

<body>
<h2>"I'm not the one" -Neo</h2>

<%
  test.processRequest(request);
%>
...
...

processRequest can throw an IOException

Here is my ErrorPage.jsp

<%@ page isErrorPage="true" 
    import="bob.Test" 
%>

<jsp:useBean id="upload" scope="session"
class="bob.Test" />

<html>
<title>Error page</title>
<body>


<h2>Exception detail:</h2>
...
...
..

Finally my bean.

  public void processRequest(HttpServletRequest req) throws IOException {
    System.err.println("processRequest");
    ...
    ...
  }


The jasper.log file shows the ErrorPage.jsp being run, but I get a 500
Internal Server Error. The error.log shows:

Premature end of script headers:

Any ideas why this simple error page will not work?

-- 
Bob Tanner <tanner@real-time.com>       | Phone : (612)943-8700
http://www.real-time.com                | Fax   : (612)943-8500
Key fingerprint =  6C E9 51 4F D5 3E 4C 66 62 A9 10 E5 35 85 39 D9