Commit 82fd4ce9 authored by Andy Wilkinson's avatar Andy Wilkinson

Fix empty context path warning when using Jetty with WebFlux

Previously, the context path was set to an empty string. The led to
Jetty logging a warning about an empty context path and then using
/ instead.

This commit avoids the warning while leaving the context path's end
result unchanged by setting the context path to /.

Closes gh-17399
parent e5757946
......@@ -173,7 +173,7 @@ public class JettyReactiveWebServerFactory extends AbstractReactiveWebServerFact
server.addConnector(createConnector(address, server));
ServletHolder servletHolder = new ServletHolder(servlet);
servletHolder.setAsyncSupported(true);
ServletContextHandler contextHandler = new ServletContextHandler(server, "", false, false);
ServletContextHandler contextHandler = new ServletContextHandler(server, "/", false, false);
contextHandler.addServlet(servletHolder, "/");
server.setHandler(addHandlerWrappers(contextHandler));
JettyReactiveWebServerFactory.logger.info("Server initialized with port: " + port);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment