Comment #11 on issue 635 by [email protected]: GuiceFilter uses wrong instance of FilterPipeline if used with multiple servlet context and multiple injectors
http://code.google.com/p/google-guice/issues/detail?id=635

mcculls,

The key point is "with your desired strategy for locating pipelines". In my case, once the Injector is created by GuiceServletContextListener I'd like to set the pipeline to injector.getInstance(FilterPipeline.class). Unfortunately, I don't have access to the GuiceFilter instance associated with the current server.

My patch moves this code into GuiceFilter.init() simply because that's the only way I found for linking GuiceFilter and GuiceServletContextListener... Now that I think about it, I guess I could still implement the same thing using your patch simply by overriding Filter.init() in my GuiceFilter subclass.

One final point: I don't understand why GuiceFilter and GuiceServletContextListener need to be separate entities. If you're going to require users to subclass GuiceFilter why not simply merge the two? Asking users to introduce two separate classes into web.xml in order to take advantage of Guice is accident-prone. We're better off having one class (especially since the two need to share data).

--
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.

Reply via email to