tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Viktor Malytskyy <viktor.malyts...@gmail.com>
Subject Possible bug in Tomcat5.0.27
Date Fri, 06 Aug 2004 21:13:41 GMT
Hi!

It seems that setting "Content-Length" header on response commits that
response (which shouldn't happen).

    protected void doGet(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
        httpServletResponse.setIntHeader("Content-Length", 0);
        httpServletResponse.sendError(404);
    }

After invoking such a servlet I'm getting IllegalStateException
java.lang.IllegalStateException
	org.apache.coyote.tomcat5.CoyoteResponseFacade.sendError(CoyoteResponseFacade.java:338)
	com.fcs.TestServlet.doGet(TestServlet.java:32)

I tried the following combination
        httpServletResponse.setIntHeader("Content-Length", 0);
        httpServletResponse.setStatus(304);

Using sniffer I see that there is no 304 response, but 200 Ok.

Can somebody clarify this?

Regards,
Viktor

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message