【发布时间】:2010-12-18 03:36:26
【问题描述】:
拥有 ServletAPI 以及可以对码头或任何其他 Web 容器进行的配置
- 我们有办法限制请求大小吗? (即如果发布超过 50 MB,则关闭连接)
- 我们能否以某种方式终止发送耗时过长的请求?
-
在您自己配置的 servlet 中分派请求时,我们能否将请求转发(而不是重定向)到“默认”servlet。 ?这总能奏效吗?
RequestDispatcher rd = getServletContext().getNamedDispatcher("default"); HttpServletRequest wrapped = new HttpServletRequestWrapper(req) { public String getServletPath() { return ""; } }; rd.forward(wrapped, resp);
提前致谢!
【问题讨论】: