users@jersey.java.net

Re: _at_RolesAllowed

From: Christopher Piggott <cpiggott_at_gmail.com>
Date: Tue, 8 Jun 2010 19:07:54 -0400

Seems like I can't do this, the PROPERTY_CONTAINER_REQUEST_FILTERS
seem to need to have a default constructor... unless somebody knows
some trick.





On Tue, Jun 8, 2010 at 4:48 PM, Christopher Piggott <cpiggott_at_gmail.com> wrote:
> My configuration is
>   grizzly-servlet-webserver 2.0.0-M3 (and required friends)
>   jersey-server 1.2
>   jersey-guice 1.2
>   guice 2.0
>
>
>
> I'm not doing much to initialize it.  My ServletAdapter is configured with:
>
>        sa.addInitParameter(ResourceConfig.PROPERTY_CONTAINER_REQUEST_FILTERS,
>                AuthenticationFilter.class.getName());
>        sa.addInitParameter(ResourceConfig.PROPERTY_RESOURCE_FILTER_FACTORIES,
>                RolesAllowedResourceFilterFactory.class.getName());
>        sa.addServletListener(ProtobufServletConfig.class.getName());
>        sa.addFilter(new GuiceFilter(), "guiceFilter", null);
>
> AuthenticationFilter.class is mine, jersey is working fine / answering
> requests but @RolesAllowed does nothing to restrict its behavior and,
> in fact, no instance of my AuthenticationFilter ever gets
> instantiated.
>
> Is it OK that my AuthenticationFilter wants to be created by
> injection?  I'm not seeing any guice errors saying it can't do so, and
> in my ServletModule.configureServlets() I'm binding the
> AuthenticationProvider class to a specific implementation.
>
> Does that sound correct?
>
> --C
>