1
내가 그리 즐 봉사 얻을 수 정적 콘텐츠그리즐리 + 정적 내용 + 서블릿 필터
나는 명명 된 서블릿
을 필터링하는 서블릿 필터를 만들 수 있습니다하지만 서블릿 필터가 정적을 필터링 할 수 없습니다 함유량. 어떻게해야합니까?
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");
당신이 내 회색 질문에서 봐 주시기 바랍니다 수 : http://stackoverflow.com/questions/35123194/jersey-2-render-swagger-static- 내용 제대로 -없이 - 후행 슬래시 – DerekY