Skip to content

Commit

Permalink
Register GuiceFilter accidentally removed in previous version (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
ofir-popowski committed Dec 5, 2021
1 parent f241988 commit ec4fafe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>io.logz</groupId>
<artifactId>guice-jersey</artifactId>
<version>1.0.15-SNAPSHOT</version>
<version>1.0.16-SNAPSHOT</version>

<packaging>jar</packaging>
<name>guice-jersey</name>
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/io/logz/guice/jersey/JerseyServer.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package io.logz.guice.jersey;

import com.google.inject.Injector;
import com.google.inject.servlet.GuiceFilter;
import com.google.inject.servlet.GuiceServletContextListener;
import io.logz.guice.jersey.configuration.JerseyConfiguration;
import io.logz.guice.jersey.configuration.JerseyWebApplicationConfigurator;
Expand All @@ -18,7 +19,9 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.servlet.DispatcherType;
import java.util.Collections;
import java.util.EnumSet;
import java.util.List;
import java.util.function.Supplier;

Expand Down Expand Up @@ -69,6 +72,8 @@ private void configureServer() {
jerseyWebApplicationConfigurator.configure(webAppContext);
webAppContext.setServer(server);

webAppContext.addFilter(GuiceFilter.class, "/*", EnumSet.allOf(DispatcherType.class));

ServletHolder holder = new ServletHolder(ServletContainer.class);
holder.setInitParameter("javax.ws.rs.Application", GuiceJerseyResourceConfig.class.getName());

Expand Down

0 comments on commit ec4fafe

Please sign in to comment.