I am having this same problem with "java.lang.IllegalStateException: Cannot
forward as OutputStream or Writer has already been obtained" error message being
displayed without going to the included "error.jsp". I didn't see any responses
to this message. More specifically, what would cause this error message? Can
anyone help me?
Thanks in advance,
Brennan
____________________Reply Separator____________________
Subject: BUG? on Handling run time exception from jsp file within <js
Author: [EMAIL PROTECTED] (A mailing list about Java Server Pages
specification and reference)
Date: 7/28/00 3:36 PM
There seems to be an issue(bug?) when handling a run time exception from
within <jsp:include> of Tomcat 3.1. If you implement the three small files
as below(error.jsp, temp.jsp, and badcode.jsp), you should be able to
reproduce my issue. In theory, it should display "You got an error".
Unfortunately, the system displayed it's ugly head and stated "Included
servlet error: 500 ..... java.lang.IllegalStateException: Cannot forward as
OutputStream or Writer has already been obtained." Are there any work
around for this issue?
Scott
(Note: please create the following files with the code as shown in a jsp
directory such as "errortest")
error.jsp:
<%@ page isErrorPage="true" %>
<%= "You got an error" %>
temp.jsp:
<%@ page errorPage="error.jsp" %>
<HTML>
<TITLE>Blah</TITLE>
</HEAD>
<body>
text here
<jsp:include page="/jsp/errortest/badcode.jsp" flush="true" />
more text
</BODY>
</HTML>
badcode.jsp:
<%@ page errorPage="error.jsp" %>
<% int i = 5/0; %>
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets