Try using the same code in a servlet, and you won't have a problem. If
you try this in a jsp and there is _any_ whitespace after the last
"%>" the jsp renderer will try to reopen the output stream (to render
the whitespace), which is already closed. That is the error you are
seeing here. If you want to include other markup or jsp's in your jsp
pages use the @include or jsp:include tags.
Best,
Garth

On 6/30/06, j.random.programmer <[EMAIL PROTECTED]> wrote:
Is this my imagination or is tomcat really this
retarded and this insanely buggy ? Or am I
doing something wrong ?

----------------- x.jsp --------------------------
foo

<%
RequestDispatcher rd =
request.getRequestDispatcher("/foo.html");
rd.include(request, response);
%>

test;
-----------------end---------------------------------

------------- start foo.html ------------------------
This is a foo page, with some dummy html
-------------------------------------------------

Now, when i try to get "x.jsp", I get:

HTTP Status 500 -

type Exception report
message
description The server encountered an internal error
() that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: getOutputStream()
has already been called for this response

org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:387)

org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)

org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)

javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

root cause
java.lang.IllegalStateException: getOutputStream() has
already been called for this response

org.apache.catalina.connector.Response.getWriter(Response.java:599)

org.apache.catalina.connector.ResponseFacade.getWriter(ResponseFacade.java:195)

org.apache.jasper.runtime.JspWriterImpl.initOut(JspWriterImpl.java:124)

org.apache.jasper.runtime.JspWriterImpl.flushBuffer(JspWriterImpl.java:117)

org.apache.jasper.runtime.PageContextImpl.release(PageContextImpl.java:191)

org.apache.jasper.runtime.JspFactoryImpl.internalReleasePageContext(JspFactoryImpl.java:115)

org.apache.jasper.runtime.JspFactoryImpl.releasePageContext(JspFactoryImpl.java:75)
        org.apache.jsp.vbb.x_jsp._jspService(x_jsp.java:56)

org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)

javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)

org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)

org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)

javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

note The full stack trace of the root cause is
available in the Apache Tomcat/5.5.16 logs.

Apache Tomcat/5.5.16

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to