mrszj / google-guice

Automatically exported from code.google.com/p/google-guice
Apache License 2.0
0 stars 0 forks source link

RequestDispatcher do not follow the specification of Servlet 2.4 #683

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
RequestDispatcher implementation in ManagedServletPipeline class and the 
specification of Servlet 2.4 do not accord.

Please see line 154 and ManagedServletPipeline.java 
http://code.google.com/p/google-guice/source/browse/extensions/servlet/src/com/g
oogle/inject/servlet/ManagedServletPipeline.java#154

"javax.servlet.forward.servlet_path" should be assigned the value of servlet 
path.
you can get it by calling HttpServletRequest#getServletPath().

When I executed GuiceServlet on Jetty server and used 
RequestDispatcher#forward(), I got ClassCastException and found this spec 
violation.
Because Jetty expect that "javax.servlet.forward.servlet_path" is String value.

Original issue reported on code.google.com by gentaro.oka on 12 Feb 2012 at 3:45

GoogleCodeExporter commented 9 years ago
Please note that there is more to that than only this one request attribute. 

It seems that none of the attributes specified by the the servlet specification 
is set for both the RequestDispatcher#forward() implementation 
(javax.servlet.forward.request_uri, javax.servlet.forward.context_path, 
javax.servlet.forward.servlet_path, javax.servlet.forward.path_info, 
javax.servlet.forward.query_string), see section 8.4.2 of the specification and 
RequestDispatcher#include() implementation (javax.servlet.include.request_uri, 
javax.servlet.include.context_path, javax.servlet.include.servlet_path, 
javax.servlet.include.path_info, javax.servlet.include.query_string), see 
section 8.4.2 of the specification. This in turn renders any code that depends 
on those atributes to be set invalid.

Original comment by erd...@gmail.com on 30 Sep 2012 at 8:03