Created
February 2, 2017 17:32
-
-
Save nhojpatrick/b720671159f2e38735fa597550d5b272 to your computer and use it in GitHub Desktop.
Grizzly Servlet Filter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HttpServer server = new GrizzlyHttpServerFactory.createHttpServer(uri, resourceConfig); | |
server.getServerConfiguration() | |
.addHttpHandler(new CLStaticHttpHandler(Application.class.getClassLoader()), "/"); | |
WebappContext webappContext = new WebappContext("grizzly web context", "/"); | |
FilterRegistration filterRegistration = webappContext.addFilter("MyFilter", MyFilter.class); | |
filterRegistration.addMappingForUrlPatterns(EnumSet.of(DispatcherType.REQUEST), "/*"); | |
webappContext.deploy(server); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment