The problem is not using forward and include on the same page. The problem
is the way forward works.

The logic of forward is '"I'm done processing, and I haven't written any
ouput back to the client, let somebody else do that"

This means you cannot forward AFTER you've written anything the the ouput
stream. Your include does a flush=true (it has to in the current spec.).
What you really want to do here (I would guess), is a
<%@ include file="header.html" %>, i.e. a static include not a dynamic
include,

Kevin Jones
DevelopMentor
www.develop.com

> -----Original Message-----
> From: Doremieux, Olivier [mailto:[EMAIL PROTECTED]]
> Sent: 30 January 2001 23:20
> To: '[EMAIL PROTECTED]'
> Subject: jsp:include & jsp:forward
>
>
> Hello,
>
> Is there some way to have a jsp:include & jsp:forward on the same page?
>
> I am trying to write some code like that :
>
> <HTML>
> <HEAD>
> <TITLE>
> foo
> </TITLE>
> </HEAD>
>
> <BODY bgcolor="#FFFFCE">
> <jsp:include page="header.html" flush="true"/>
> <BR><BR>
> <CENTER><b>Updating the Database... Please Wait....Done.</b></CENTER>
> <%
> // Database Update here
> }
> %>
> <jsp:forward page="/NextPage.jsp"/>
> </BODY>
> </HTML>
>
>
> But I am getting the following error :
>
> Error: 500
> Location: /processTask0.jsp
> Internal Servlet Error:
>
> java.io.IOException: Error: Attempt to clear a buffer that's already been
> flushed
>       at
> org.apache.jasper.runtime.JspWriterImpl.clear(JspWriterImpl.java:180)
>       at
> _0002fprocessTask_00030_0002ejspprocessTask0_jsp_2._jspService(_00
> 02fprocess
> Task_00030_0002ejspprocessTask0_jsp_2.java:90)
>       at
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
>       at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>       at
> org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(Jsp
> Servlet.ja
> va:177)
>       at
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:318)
>       at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:391)
>       at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>       at
> org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
>       at org.apache.tomcat.core.Handler.service(Handler.java:286)
>       at
> org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
>       at
> org.apache.tomcat.core.ContextManager.internalService(ContextManag
> er.java:79
> 7)
>       at
> org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
>       at
> org.apache.tomcat.service.http.HttpConnectionHandler.processConnec
> tion(HttpC
> onnectionHandler.java:210)
>       at
> org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
>       at
> org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
>       at java.lang.Thread.run(Thread.java:484)
>
>
> Any idea how to fix that?
>
> Thank you,
>
> -----------------------------
> Olivier Doremieux
> Senior Staff Engineer
> Celera Applied Genomics
> 384 Foster City Blvd.,
> Foster City, CA 94404
> Tel: 650-554-2243
> FAX: 650-638-6222
> e-mail: [EMAIL PROTECTED]
> -----------------------------
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to