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. 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. </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>>From: "info@participo" <[EMAIL PROTECTED]>
><DIV></DIV>>Reply-To: [EMAIL PROTECTED]
><DIV></DIV>>To: JRun-Talk <[EMAIL PROTECTED]>
><DIV></DIV>>Subject: Response has already been committed
><DIV></DIV>>Date: Wed, 25 Apr 2001 14:05:23 +0200
><DIV></DIV>>
><DIV></DIV>>This is a multi-part message in MIME format.
><DIV></DIV>>
><DIV></DIV>>------=_NextPart_000_002F_01C0CD90.C54B6050
><DIV></DIV>>Content-Type: text/plain;
><DIV></DIV>> charset="iso-8859-1"
><DIV></DIV>>Content-Transfer-Encoding: quoted-printable
><DIV></DIV>>
><DIV></DIV>>Since we have migrated from JRun 2.3.3 to JRun 3.0 the next
>exception =
><DIV></DIV>>was thrown occasionally. Can anyone help me with this?
><DIV></DIV>>
><DIV></DIV>>java.lang.IllegalStateException: Response has already been
>committed
><DIV></DIV>> at =
><DIV></DIV>>allaire.jrun.servlet.JRunResponse.resetContent(../servlet/JRunResponse.ja=
><DIV></DIV>>va:170)
><DIV></DIV>> at =
><DIV></DIV>>allaire.jrun.servlet.JRunResponse.sendRedirect(../servlet/JRunResponse.ja=
><DIV></DIV>>va:648)
><DIV></DIV>> at =
><DIV></DIV>>allaire.jrun.servlet.JRunResponse.sendRedirect(../servlet/JRunResponse.ja=
><DIV></DIV>>va:641)
><DIV></DIV>>
><DIV></DIV>>Micky.
><DIV></DIV>>
><DIV></DIV>>
><DIV></DIV>>
><DIV></DIV>>------=_NextPart_000_002F_01C0CD90.C54B6050
><DIV></DIV>>Content-Type: text/html;
><DIV></DIV>> charset="iso-8859-1"
><DIV></DIV>>Content-Transfer-Encoding: quoted-printable
><DIV></DIV>>
><DIV></DIV>><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0
>Transitional//EN">
><DIV></DIV>>
><DIV></DIV>>>http-equiv=3DContent-Type>
><DIV></DIV>>
><META content='3D"MSHTML' name=3DGENERATOR 5.00.2314.1000?>
><DIV></DIV>>
><STYLE></STYLE>
>
><DIV></DIV>>
><DIV></DIV>>
><DIV></DIV>>
><DIV><FONT face=3DArial size=3>Since we have migrated from JRun 2.3.3 =
></DIV>>to JRun 3.0=20
><DIV></DIV>>the next exception was thrown occasionally. Can anyone help
>me with=20
><DIV></DIV>>this?</FONT>
><DIV></DIV>
><DIV></DIV>>
><DIV> </DIV>
><DIV></DIV>>
><DIV><FONT face=3DArial size=3>java.lang.IllegalStateException: =
></DIV>>Response has=20
><DIV></DIV>>already been committed<BR> at=20
><DIV></DIV>>allaire.jrun.servlet.JRunResponse.resetContent(../servlet/JRunResponse.ja=
><DIV></DIV>>va:170)<BR> at=20
><DIV></DIV>>allaire.jrun.servlet.JRunResponse.sendRedirect(../servlet/JRunResponse.ja=
><DIV></DIV>>va:648)<BR> at=20
><DIV></DIV>>allaire.jrun.servlet.JRunResponse.sendRedirect(../servlet/JRunResponse.ja=
><DIV></DIV>>va:641)</FONT>
><DIV></DIV>
><DIV></DIV>>
><DIV><FONT face=3DArial size=3></FONT> </DIV>
><DIV></DIV>>
><DIV><FONT face=3DArial size=3>Micky.</FONT></DIV>
><DIV></DIV>>
><DIV><FONT face=3DArial size=3><BR> </DIV></FONT>
><DIV></DIV>>
><DIV></DIV>>------=_NextPart_000_002F_01C0CD90.C54B6050--
><DIV></DIV>>
><DIV></DIV>>Archives:
>http://www.mail-archive.com/[email protected]/
><DIV></DIV>>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