发送100继续使用Java Servlet API [英] Sending 100 Continue using Java Servlet API

查看:133
本文介绍了发送100继续使用Java Servlet API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在使用Java Servlet API(HttpServletResponse)处理整个请求后发送100 ContinueHTTP状态代码,然后再发送一些其他状态代码?

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)?

我找不到任何明确的否答案,虽然API似乎不支持它。

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

推荐答案

我假设你意思是100继续。

I assume you mean "100 Continue".

答案是:不,你不能(至少不是它的预期方式,因为临时回复)。通常,servlet引擎会在请求需要时自动执行。当然,这使得servlet无法阻止发送100状态 - 这个问题在Servlet API中是一个已知问题,并且已经知道现在感觉像是eons。

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.

这篇关于发送100继续使用Java Servlet API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆