From 6a2f39fb3cbaf190e8a6b6136c4cf74e65a12f8e Mon Sep 17 00:00:00 2001 From: Jan Bartel Date: Wed, 22 Nov 2017 00:36:20 +0100 Subject: [PATCH] Issue #1940 --- .../jetty/cdi/servlet/EmbeddedCdiHandler.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/jetty-cdi/cdi-servlet/src/main/java/org/eclipse/jetty/cdi/servlet/EmbeddedCdiHandler.java b/jetty-cdi/cdi-servlet/src/main/java/org/eclipse/jetty/cdi/servlet/EmbeddedCdiHandler.java index 612eb5874aa..01142158b2a 100644 --- a/jetty-cdi/cdi-servlet/src/main/java/org/eclipse/jetty/cdi/servlet/EmbeddedCdiHandler.java +++ b/jetty-cdi/cdi-servlet/src/main/java/org/eclipse/jetty/cdi/servlet/EmbeddedCdiHandler.java @@ -23,6 +23,11 @@ import java.util.Collections; import java.util.Set; import javax.servlet.ServletContext; +import javax.servlet.http.HttpSessionActivationListener; +import javax.servlet.http.HttpSessionAttributeListener; +import javax.servlet.http.HttpSessionBindingListener; +import javax.servlet.http.HttpSessionIdListener; +import javax.servlet.http.HttpSessionListener; import org.eclipse.jetty.servlet.ServletContextHandler; import org.eclipse.jetty.util.log.Log; @@ -119,6 +124,14 @@ public class EmbeddedCdiHandler extends ServletContextHandler // add the rest of the Weld Listeners ctx.addListener(weldListener); + if ((weldListener instanceof HttpSessionActivationListener) + || (weldListener instanceof HttpSessionAttributeListener) + || (weldListener instanceof HttpSessionBindingListener) + || (weldListener instanceof HttpSessionListener) + || (weldListener instanceof HttpSessionIdListener)) + { + getSessionHandler().addEventListener(weldListener); + } } finally {