Status: New
Owner: ----
New issue 648 by [email protected]: GuiceFilter/ServletModule does
not support filters that wrap the request or response
http://code.google.com/p/google-guice/issues/detail?id=648
The GuiceFilter class stores the HttpServletRequest and HttpServletResponse
objects in a threadlocal variable (localContext) when the GuiceFilter
instance is invoked at the start of request processing.
The InternalServletModule class then defines provider methods to
support "@Inject HttpServletRequest" and "@Inject HttpServletResponse" by
fetching data from GuiceFilter.localContext.
However it is possible (and in fact quite common) for filters to create
wrapper objects for HttpServletRequest and HttpServletResponse and pass
these down to later filters + servlet.
Classes that let Guice inject the request and response objects currently
always get the original objects not the wrapped ones, because
GuiceFilter.localContext is never updated.
At the very least, this is surprising and should be well documented in
GuiceFilter and in ServletModule. However IMO it would be nicer for the
FilterPipeline implementation to update GuiceFilter.localContext when an
invoked filter wraps the request or response.
--
You received this message because you are subscribed to the Google Groups
"google-guice-dev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-guice-dev?hl=en.