users@jersey.java.net

Re: [Jersey] Jersey and (dynamic) basic authentication?

From: Casper Bang <casper_at_jbr.dk>
Date: Wed, 25 Mar 2009 23:02:16 +0100

Thanks, that's a good example. Although I am not really able to make the per
request filter work with Tomcat. I guess I would somehow need to register
this in my web.xml to mimic what's done to the stand-alone Grizzly setup:

        initParams.put("com.sun.jersey.config.property.packages",
                "com.sun.jersey.samples.contacts.server;" +
                "com.sun.jersey.samples.contacts.server.auth");
        initParams.put(ResourceConfig.PROPERTY_CONTAINER_REQUEST_FILTERS,
                SecurityFilter.class.getName());
        initParams.put(ResourceConfig.PROPERTY_RESOURCE_FILTER_FACTORIES,
                RolesAllowedResourceFilterFactory.class.getName());

Would a kind soul familiar with Grizzly know how to do the same for Tomcat?

Thanks,
Casper