This error can be caused by using the <jsp:forward> tag with unbuffered
output, that is where buffer="none" is specified in the page directive
<%@page buffer="none" %>
If there is data in the out object when the forward tag is reached then the
IllegalStateException is thrown.
regards,
Richard
____________________Reply Separator____________________
Brennan OShea <[EMAIL PROTECTED]> wrote :
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
__________________________________________________________________
JHC Plc
Software Professionals
http://www.jhc.co.uk
__________________________________________________________________
17 Macklin Street, London, WC2B 5NH
t: +44 (0)20 7916 1188 f: +44 (0)20 7916 1590
2nd Floor, 21 Bennetts Hill, Birmingham, B2 5QP
t: +44 (0)121 605 0808 f: +44 (0)121 605 0888
3rd Floor, 41 Grainger Street, Newcastle, NE1 5JE
t: +44 (0)191 260 2425 f: +44 (0)191 222 0126
__________________________________________________________________
This email (and any associated files) is intended only
for the addressee(s) above and may be confidential, contain
information that is copyright or which constitutes a trade
secret. If you have received it in error, you must take no
action based on it (nor copy it or show it to another person).
Please delete it from your system immediately and telephone
us to confirm.
__________________________________________________________________
Registered in England No. 2243258
Registered Office:
2nd Floor, 21 Bennetts Hill, Birmingham, B2 5QP
__________________________________________________________________
===========================================================================
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