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

Re: [TCLUG-DEVEL:245] Simple error page in jsp



Bob Tanner wrote:
> 
> 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?

You caught me at home without all my source code to look at. 
<processRequest> is not one of the methods necessary to implement the
JSPTag interface. Is <processRequest> called by <doStartTag> or
<doEndTag> and they proprogate up the IOException?  What are the return
indicators in those methods, by this I mean indicators such as SKIP_BODY
or EVAL_PAGE?

-- 
Perry Hoekstra

---
"I don't see much sense in that," said Rabbit. 
"No," said Pooh humbly, "there isn't. But there was going to be when I
began it. It's just that something happened to it along the way."