response.sendError(200)does not work in Tomcat
843840Sep 17 2002 — edited Sep 18 2002Hi,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