Stop using Tomcat's deprecated addServletMappingDecoded() method

(cherry picked from commit 4f51801320)
This commit is contained in:
Sam Brannen
2026-09-30 12:50:37 +02:00
parent 1b4955e49f
commit 4d3beb5c3b
2 changed files with 2 additions and 2 deletions
@@ -83,7 +83,7 @@ public class TomcatHttpServer extends AbstractHttpServer {
File base = new File(System.getProperty("java.io.tmpdir"));
Context rootContext = tomcatServer.addContext(this.contextPath, base.getAbsolutePath());
Tomcat.addServlet(rootContext, "httpHandlerServlet", servlet).setAsyncSupported(true);
rootContext.addServletMappingDecoded(this.servletMapping, "httpHandlerServlet");
rootContext.addServletMapping(this.servletMapping, "httpHandlerServlet", false);
if (wsListener != null) {
rootContext.addApplicationListener(wsListener.getName());
}
@@ -86,7 +86,7 @@ public class TomcatWebSocketTestServer implements WebSocketTestServer {
this.context = this.tomcatServer.addContext("", System.getProperty("java.io.tmpdir"));
this.context.addApplicationListener(WsContextListener.class.getName());
Tomcat.addServlet(this.context, "dispatcherServlet", new DispatcherServlet(wac)).setAsyncSupported(true);
this.context.addServletMappingDecoded("/", "dispatcherServlet");
this.context.addServletMapping("/", "dispatcherServlet", false);
for (Filter filter : filters) {
FilterDef filterDef = new FilterDef();
filterDef.setFilterName(filter.getClass().getName());