开发者

Tomcat servlet RequestDispatcher forward overrides the response code

开发者 https://www.devze.com 2023-03-26 22:08 出处:网络
I\'m seeing some strange behavior wit开发者_StackOverflow社区h a RequestDispatcher forward in Tomcat. I\'m mentioning Tomcat because the the exact code doesn\'t generate the problem on Jetty, so it is

I'm seeing some strange behavior wit开发者_StackOverflow社区h a RequestDispatcher forward in Tomcat. I'm mentioning Tomcat because the the exact code doesn't generate the problem on Jetty, so it is probably related to the servlet implementation.

Spring does a forward on an existing request/response - at which point, the response has the http status code of 404; after the forward, the code is 500.

The actual logic happens at: InternalResourceView.renderMergedOutputModel. The Spring code does mention that the forwarded resource is supposed to determine the content type itself, but nothing about the code being overridden as well.

I'm using Spring 3.0.5 on a JDK 6.0.26.

0

精彩评论

暂无评论...
验证码 换一张
取 消