I can get Grizzly to serve static content
I can create the servlet filter to filter a named servlet
But I can't get the servlet filter to filter the static content. How do I do that?
Here is the code I have so far:
WebappContext webappContext = new WebappContext("grizzly web context", "");
FilterRegistration authFilterReg = webappContext.addFilter("Authentication Filter", org.package.AuthenticationFilter.class);
// If I create a ServletContainer, I can add the filter to it like this:
// authFilterReg.addMappingForServletNames(EnumSet.allOf(DispatcherType.class), "servletName");
HttpServer httpServer = GrizzlyHttpServerFactory.createHttpServer(BASE_URI);
webappContext.deploy(httpServer);
// This works, but the content does not go through the authentication filter above
httpServer.getServerConfiguration().addHttpHandler(new StaticHttpHandler(absolutePath), "/static");