Search code examples
javahttpservletshttp-status-code-100

Sending 100 Continue using Java Servlet API


Is it possible to send "100 Continue" HTTP status code, and then later some other status code after processing entire request using Java Servlet API (HttpServletResponse)?

I can't find any definitive "No" answer, although API doesn't seem to support it.


Solution

  • I assume you mean "100 Continue".

    The answer is: no, you can't (at least not the way it's intended, as provisional response). In general, the servlet engine will do it automatically, when the request requires it. Of course this makes it impossibe for the servlet to prevent sending the 100 status -- this issue is a known problem in the Servlet API, and has been known for what feels like eons now.