Weblogic isn't the best at obeying the spec. (From past painful experience)

You probably have code which is sending data to the browser and then the response is getting committed. Then you try a RequestDispatcher.forward(). This is illegal with respect to the spec. It could be because weblogic had a larger buffer than tomcat before flushing. See the jsp(and/or servlet) spec for the declaration to enlarge the buffer for your request.

A simple way to reproduce:
<%
   /* Write a 50kb string to ensure response is committed */
   char[] c = new char[1024*50];
   java.util.Arrays.fill(c,'z')
   out.println(new String(c));
%>
   <jsp:forward page="moreCowbell.jsp"/>

---------------
Another common way is to get this error is by performing a sendRedirect in a jsp and then printing more data out, for example:
<% response.sendRedirect("moreCowbell.jsp");%>
Wacky text here.
---------------


A simple way to resolve:
<% response.sendRedirect("moreCowbell.jsp");
   return;
%>
Wacky text here.


-Tim


Aidan Monroe wrote:
I have a .war file that runs perfectly in WebLogic
7.0. Today I tried to run that same .war in Tomcat
4.0.6. Unfortunately, it did not run. I get the
following error:

java.lang.IllegalStateException: Cannot forward after
response has been committed

Now, I know what this error means, but I don't know
why I would get it when I run in Tomcat but not
WebLogic. Is there something that I need to set in
Tomcat to avoid this?

Please note that I am new to Tomcat so I apologize in
advance if this is a stupid question.

Aidan


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



Reply via email to