By the way, the filter configuration s really
filter("/*").through(RequestAuthenticationServletFilter.class);

thx.

On Jul 16, 4:20 pm, Jas <[email protected]> wrote:
> So I am trying to inject a few dependencies into a so-called
> AuthFilter and I control the invokation of this AuthFilter from within
> the configureServlets() override. Something like: (along with custom
> binding module)
>
> public class GuiceServletConfig extends GuiceServletContextListener {
>     @Override
>     protected Injector getInjector() {
>         return Guice.createInjector(new ServletModule() {
>             @Override
>             public void configureServlets() {
>                 filter("/*").through(AuthenticationFilter.class);
>             }
>         },
>                 new GuiceConfigModule()
>         );
>     }
>
> I do have the web.xml configured as instructed with the GuiceFilter
> mapping. I should also mention that the web.xml also contains a
> servlet mapping for Jersey with some init-params (not mentioned
> below):
>
> <servlet>
>         <servlet-name>Jersey Web Application</servlet-name>
>         <servlet-
> class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-
> class>
> </servlet>
>
> The entire application is deployed on Glassfish.
>
> The problem is: I don't see my AuthFilter getting invoked in the
> chain. Am i missing something in the chain?
>
> Here's the signature for the AuthFilter class:
>
> @Singleton
> public class RequestAuthenticationServletFilter implements Filter {
>     private AuthTokenValidator authTokenValidator;
>     private UrlAccountIdExtractor urlAccountIdExtractor;
>
>     @Inject
>     public RequestAuthenticationServletFilter(AuthTokenValidator
> authTokenValidator, UrlAccountIdExtractor urlAccountIdExtractor) {
>         this.authTokenValidator = authTokenValidator;
>         this.urlAccountIdExtractor = urlAccountIdExtractor;
>     }
>
>     ......
>
> }
>
> Any help would be most appreciated. I am new to Java for I apologize
> if I am missing something very glaring! THANKS.

-- 
You received this message because you are subscribed to the Google Groups 
"google-guice" 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?hl=en.

Reply via email to