Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

response.sendError(200)does not work in Tomcat

843840Sep 17 2002 — edited Sep 18 2002
Hi,everyone,
I'm using a servlet named as "Router" to receive messages from client. Because the processing time of "Router"is quite long, I want it to send back the "200 OK" response to the client at the beginning of the service() method. My Router.java is like this:
public class Router extends HttpServlet
{
public void service(HttpServletRequest request, HttpServletResponse response)
throws ServletException
{
// send a response code "200 OK" to the client
response.sendError(200);
...
//processing the received message
}
}
My program works well in ServletExec server, but in Tomcat, it does not work. In tomcat, the 200 OK can only be sent back after the whole service() process is finished. The "response.sendError(200);" seems does not work at all. Can anyone help me to resolve it?

Thanks a lot!

grass
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 16 2002
Added on Sep 17 2002
2 comments
381 views