Hi,
I am having some trouble serving static content via the GuiceContainer. Here is my injector logic.
@Overrideprotected Injector getInjector() { return Guice.createInjector(new JerseyServletModule() { @Override protected void configureServlets() { install(new JpaPersistModule("my-persistence-unit")); filter("/*").through(PersistFilter.class); ApplicationConfiguration.bindResources(binder()); bind(RestController.class); final Map<String, String> parameters = new HashMap<String, String>(); parameters.put(ServletContainer.JSP_TEMPLATES_BASE_PATH, "/WEB-INF/jsp"); // parameters.put(ServletContainer.FEATURE_FILTER_FORWARD_ON_404, "true");
parameters.put(ServletContainer.PROPERTY_WEB_PAGE_CONTENT_REGEX, "/(js|css)/.*"); filter("/*").through(GuiceContainer.class, parameters); } });}
According to the documentation using the GuiceContainer as a filter should do the trick as long as I specify the PROPERTY_WEB_PAGE_CONTENT_REGEX. Unfortunately this does not work, I have also tried FEATURE_FILTER_FORWARD_ON_404 but it also doesn't give me any results.
All the resources are under:/WEB-INF/js/*/WEB-INF/css/*
The war file is properly build and when expanded through Tomcat 7.0.32 all is in place.
Any ideas?
Thank you.