Another cause can be demonstrated with the following scriptlet code ...

   if (session.getAttribute("articles") == null) {
       response.sendRedirect("controllerServlet/home");
    }
   if (session.getAttribute("siteState") == null) {
       response.sendRedirect("controllerServlet/home");
   }

The second if is tested even if the first if is true.  If the second if is
true another sendRedirect is attempted causing the error.  It should be
coded as ...

   if (session.getAttribute("articles") == null) {
       response.sendRedirect("controllerServlet/home");
       return;
   }
   if (session.getAttribute("siteState") == null) {
       response.sendRedirect("controllerServlet/home");
       return;
   }

Steve

-----Original Message-----
From: Dave Been [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 08, 2002 2:34 PM
To: 'Tomcat Users List'
Subject: RE: Error: 500 (Response has already been committed) !!!


I have seen this when trying to write headers on an already flushed response
(hence "committed").   By moving my header writes up above the data write
for the post response, i avoided the problem.

I think this only came up when i went from tomcat 4 to 4.0.4, but its been
awhile now.

dave

-----Original Message-----
From: Henry Penaranda [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 08, 2002 12:35 PM
To: [EMAIL PROTECTED]
Subject: Error: 500 (Response has already been committed) !!!



I have this message:

Error: 500
Location: /anydirectory/jsp/anyfolder/anyfile.jsp
Internal Servlet Error:
java.lang.IllegalStateException: Response has already been committed
at
org.apache.tomcat.core.HttpServletResponseFacade.sendError(HttpServletRespon
seFacade.java:157)
at
org.apache.jasper.runtime.JspServlet.unknownException(JspServlet.java:299)
at org.apache.jasper.runtime.JspServlet.service(JspServlet.java:377)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java:503)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:559)
at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
onnectionHandler.java:160)
at
org.apache.tomcat.service.TcpConnectionThread.run(SimpleTcpEndpoint.java:338
)
at java.lang.Thread.run(Thread.java:479)

I never see this message Before. Nothing about JSP is running, all JSP
gadget have a similar message. The Only thing that I do was reboot the
server !!

I need help

Regards

Hank



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





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

Reply via email to