Comment #23 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,

I think GuiceFilter has two separate roles:

1. Provide an Injector to registered servlets/filters. Meaning, the servlet API instantiates GuiceFilter and it injects any registered servlets/filters. The emphasis here is that without GuiceFilter we wouldn't have access to an Injector.

2. Replace web.xml. Convert your configuration into type-safe code.

Assuming I understand your use-case correctly, I argue that GuiceFilter doesn't need to serve different pipelines (more on this below).

Keeping #1 in mind, I'd advocate merging GuiceFilter and GuiceServletContextListener (such that each GuiceFilter instance would be bound to exactly one Injector). Users who wish to specify multiple injectors could simply specify multiple GuiceFilter instances (one per Injector). The Servlet API's existing filter-chain mechanism would traverse one GuiceFilter/injector after another.

The merged class would still enable you to move your configuration from web.xml into code. Instead of having one entry per GuiceServletContextListener subclass in web.xml, you'd have one line per GuiceFilter with its own Injector.

Would you be able to implement your use-case in terms of multiple GuiceFilter subclasses, as mentioned above?

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