I'm trying to use Grizzly to create a server to run a REST service that I've developed using Jersey. I'm creating the Grizzly server using:
final String baseUri = "http://localhost:9998/";
final Map<String, String> initParams = new HashMap<String, String>();
initParams.put("com.sun.jersey.config.property.packages", "me.my.rest.package");
SelectorThread threadSelector = GrizzlyWebContainerFactory.create(baseUri, initParams);
as all the examples I've found seem to suggest. This is fine, the server starts and is able to forward incoming requests to my resource classes.
However, the service implementation requires it to use a servlet filter. It appears that Grizzly supports the definition of filters and other similar servlet related configuration options, via the ServletAdapter class. My problem is that I can't work out how to define a filter when using a com.sun.jersey.api.container.grizzly.GrizzlyWebContainerFactory which provides Jersey integration.
Any ideas?