I believe what is happening is that you are filling up your output buffer 
and it auto flushes, then you try to do a redirect or forward and since the 
buffer has been flushed, the response is implicitly committed.  I ran into 
this in a couple of places in my code, and could not move the forward up in 
the page so I just increased the buffer size as follows and it works like a 
champ:

<%
    //THIS HAS TO BE DONE FIRST....DO NOT MOVE!!!!!!!!!!!!!!
    response.setBufferSize(1024 * 15);
%>

As stated, this has to be done at the top of the JSP file.  Obviously, the 
more HTML and Client side script you have in your page before your 
redirect/forward (which in the generated servlet becomes out.print(....)) 
the more likely you are to encounter this exception.


>From: "Bin Zhou" <[EMAIL PROTECTED]>
>Reply-To: [EMAIL PROTECTED]
>To: JRun-Talk <[EMAIL PROTECTED]>
>Subject: Re: Response has already been committed
>Date: Wed, 25 Apr 2001 10:51:52 -0400
>
><html><DIV>
><P>Micky,</P>
><P>Did you redirect the page to somewhere else after the html head has been 
>generated.&nbsp; Although JSP claims that it can do the redirect/forward 
>anywhere in the jsp, however in Jrun 3, if the file size is quite big and 
>if you have html header part before the redirect/forward happens, you will 
>get this error.&nbsp;</P>
><P>What you can do to solve this is to put you redirect/forward as the 
>first part of your page before even the html header is generated.</P>
><P>Hope this will help.</P>
><P>Bin<BR><BR></P></DIV>
><DIV></DIV>
><DIV></DIV>&gt;From: "info@participo" <[EMAIL PROTECTED]>
><DIV></DIV>&gt;Reply-To: [EMAIL PROTECTED]
><DIV></DIV>&gt;To: JRun-Talk <[EMAIL PROTECTED]>
><DIV></DIV>&gt;Subject: Response has already been committed
><DIV></DIV>&gt;Date: Wed, 25 Apr 2001 14:05:23 +0200
><DIV></DIV>&gt;
><DIV></DIV>&gt;This is a multi-part message in MIME format.
><DIV></DIV>&gt;
><DIV></DIV>&gt;------=_NextPart_000_002F_01C0CD90.C54B6050
><DIV></DIV>&gt;Content-Type: text/plain;
><DIV></DIV>&gt; charset="iso-8859-1"
><DIV></DIV>&gt;Content-Transfer-Encoding: quoted-printable
><DIV></DIV>&gt;
><DIV></DIV>&gt;Since we have migrated from JRun 2.3.3 to JRun 3.0 the next 
>exception =
><DIV></DIV>&gt;was thrown occasionally. Can anyone help me with this?
><DIV></DIV>&gt;
><DIV></DIV>&gt;java.lang.IllegalStateException: Response has already been 
>committed
><DIV></DIV>&gt; at =
><DIV></DIV>&gt;allaire.jrun.servlet.JRunResponse.resetContent(../servlet/JRunResponse.ja=
><DIV></DIV>&gt;va:170)
><DIV></DIV>&gt; at =
><DIV></DIV>&gt;allaire.jrun.servlet.JRunResponse.sendRedirect(../servlet/JRunResponse.ja=
><DIV></DIV>&gt;va:648)
><DIV></DIV>&gt; at =
><DIV></DIV>&gt;allaire.jrun.servlet.JRunResponse.sendRedirect(../servlet/JRunResponse.ja=
><DIV></DIV>&gt;va:641)
><DIV></DIV>&gt;
><DIV></DIV>&gt;Micky.
><DIV></DIV>&gt;
><DIV></DIV>&gt;
><DIV></DIV>&gt;
><DIV></DIV>&gt;------=_NextPart_000_002F_01C0CD90.C54B6050
><DIV></DIV>&gt;Content-Type: text/html;
><DIV></DIV>&gt; charset="iso-8859-1"
><DIV></DIV>&gt;Content-Transfer-Encoding: quoted-printable
><DIV></DIV>&gt;
><DIV></DIV>&gt;<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 
>Transitional//EN">
><DIV></DIV>&gt;
><DIV></DIV>&gt;&gt;http-equiv=3DContent-Type&gt;
><DIV></DIV>&gt;
><META content='3D"MSHTML' name=3DGENERATOR 5.00.2314.1000?>
><DIV></DIV>&gt;
><STYLE></STYLE>
>
><DIV></DIV>&gt;
><DIV></DIV>&gt;
><DIV></DIV>&gt;
><DIV><FONT face=3DArial size=3>Since we have migrated from JRun 2.3.3 = 
></DIV>&gt;to JRun 3.0=20
><DIV></DIV>&gt;the next exception was thrown occasionally. Can anyone help 
>me with=20
><DIV></DIV>&gt;this?</FONT>
><DIV></DIV>
><DIV></DIV>&gt;
><DIV>&nbsp;</DIV>
><DIV></DIV>&gt;
><DIV><FONT face=3DArial size=3>java.lang.IllegalStateException: = 
></DIV>&gt;Response has=20
><DIV></DIV>&gt;already been committed<BR>&nbsp;at=20
><DIV></DIV>&gt;allaire.jrun.servlet.JRunResponse.resetContent(../servlet/JRunResponse.ja=
><DIV></DIV>&gt;va:170)<BR>&nbsp;at=20
><DIV></DIV>&gt;allaire.jrun.servlet.JRunResponse.sendRedirect(../servlet/JRunResponse.ja=
><DIV></DIV>&gt;va:648)<BR>&nbsp;at=20
><DIV></DIV>&gt;allaire.jrun.servlet.JRunResponse.sendRedirect(../servlet/JRunResponse.ja=
><DIV></DIV>&gt;va:641)</FONT>
><DIV></DIV>
><DIV></DIV>&gt;
><DIV><FONT face=3DArial size=3></FONT>&nbsp;</DIV>
><DIV></DIV>&gt;
><DIV><FONT face=3DArial size=3>Micky.</FONT></DIV>
><DIV></DIV>&gt;
><DIV><FONT face=3DArial size=3><BR>&nbsp;</DIV></FONT>
><DIV></DIV>&gt;
><DIV></DIV>&gt;------=_NextPart_000_002F_01C0CD90.C54B6050--
><DIV></DIV>&gt;
><DIV></DIV>&gt;Archives: 
>http://www.mail-archive.com/[email protected]/
><DIV></DIV>&gt;Unsubscribe: 
>http://www.houseoffusion.com/index.cfm?sidebar=lists
><DIV></DIV><br clear=all><hr>Get your FREE download of MSN Explorer at <a 
>href="http://explorer.msn.com";>http://explorer.msn.com</a><br></p></html>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to