From a2260dd9a1786a7f6dfc91dfc90ed050aa82fa61 Mon Sep 17 00:00:00 2001 From: Jan Bartel Date: Wed, 30 Sep 2020 16:52:35 +0200 Subject: [PATCH] Issue #5360 Ensure @WebListeners have origin attr in quickstart-web.xml (#5371) Signed-off-by: Jan Bartel --- .../org/eclipse/jetty/annotations/WebListenerAnnotation.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/WebListenerAnnotation.java b/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/WebListenerAnnotation.java index dc151ff3f1d..794764cbd7b 100644 --- a/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/WebListenerAnnotation.java +++ b/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/WebListenerAnnotation.java @@ -23,6 +23,7 @@ import javax.servlet.ServletContextAttributeListener; import javax.servlet.ServletContextListener; import javax.servlet.ServletRequestAttributeListener; import javax.servlet.ServletRequestListener; +import javax.servlet.annotation.WebListener; import javax.servlet.http.HttpSessionAttributeListener; import javax.servlet.http.HttpSessionIdListener; import javax.servlet.http.HttpSessionListener; @@ -84,6 +85,7 @@ public class WebListenerAnnotation extends DiscoveredAnnotation ListenerHolder h = _context.getServletHandler().newListenerHolder(new Source(Source.Origin.ANNOTATION, clazz.getName())); h.setHeldClass(clazz); _context.getServletHandler().addListener(h); + metaData.setOrigin(clazz.getName() + ".listener", clazz.getAnnotation(WebListener.class), clazz); } } else