From 12cfcc6880644cbf5a62967b63bac42de975050d Mon Sep 17 00:00:00 2001 From: Jan Bartel Date: Fri, 30 Aug 2024 11:08:11 +1000 Subject: [PATCH] Issue #12207 reinstate DefaultHandler for jetty maven plugin --- .../src/main/java/org/eclipse/jetty/maven/ServerSupport.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/jetty-core/jetty-maven/src/main/java/org/eclipse/jetty/maven/ServerSupport.java b/jetty-core/jetty-maven/src/main/java/org/eclipse/jetty/maven/ServerSupport.java index 5dd105b260c5..cc766b67706d 100644 --- a/jetty-core/jetty-maven/src/main/java/org/eclipse/jetty/maven/ServerSupport.java +++ b/jetty-core/jetty-maven/src/main/java/org/eclipse/jetty/maven/ServerSupport.java @@ -23,10 +23,12 @@ import org.eclipse.jetty.maven.PluginLog; import org.eclipse.jetty.security.LoginService; import org.eclipse.jetty.server.Connector; +import org.eclipse.jetty.server.Handler; import org.eclipse.jetty.server.RequestLog; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.handler.ContextHandler; import org.eclipse.jetty.server.handler.ContextHandlerCollection; +import org.eclipse.jetty.server.handler.DefaultHandler; import org.eclipse.jetty.util.resource.ResourceFactory; import org.eclipse.jetty.xml.XmlConfiguration; @@ -56,6 +58,9 @@ public static void configureHandlers(Server server, List context if (requestLog != null) server.setRequestLog(requestLog); + if (server.getDefaultHandler() == null) + server.setDefaultHandler(new DefaultHandler()); + ContextHandlerCollection contexts = findContextHandlerCollection(server); if (contexts == null) {