Align with Servlet 6.0 and introduce support for Jakarta WebSocket 2.1

Includes corresponding build upgrade to Tomcat 10.1.1 and Undertow 2.3.0
(while retaining runtime compatibility with Tomcat 10.0 and Undertow 2.2)

Closes gh-29435
Closes gh-29436
This commit is contained in:
Juergen Hoeller
2022-11-06 16:08:30 +01:00
parent 4b22a4a0d8
commit 19cf503534
37 changed files with 289 additions and 340 deletions

View File

@@ -507,12 +507,6 @@ class DefaultServerRequest implements ServerRequest {
this.status = sc;
}
@Override
@Deprecated
public void setStatus(int sc, String sm) {
this.status = sc;
}
@Override
public int getStatus() {
return this.status;
@@ -553,18 +547,6 @@ class DefaultServerRequest implements ServerRequest {
throw new UnsupportedOperationException();
}
@Override
@Deprecated
public String encodeUrl(String url) {
throw new UnsupportedOperationException();
}
@Override
@Deprecated
public String encodeRedirectUrl(String url) {
throw new UnsupportedOperationException();
}
@Override
public void sendError(int sc, String msg) throws IOException {
throw new UnsupportedOperationException();

View File

@@ -98,6 +98,7 @@ public class DispatcherServletTests {
complexConfig.addInitParameter("publishContext", "false");
complexConfig.addInitParameter("class", "notWritable");
complexConfig.addInitParameter("unknownParam", "someValue");
complexConfig.addInitParameter("jakarta.servlet.http.legacyDoHead", "true");
simpleDispatcherServlet = new DispatcherServlet();
simpleDispatcherServlet.setContextClass(SimpleWebApplicationContext.class);

View File

@@ -110,7 +110,9 @@ public abstract class AbstractServletHandlerMethodTests {
}
};
servlet.init(new MockServletConfig());
MockServletConfig config = new MockServletConfig();
config.addInitParameter("jakarta.servlet.http.legacyDoHead", "true");
servlet.init(config);
return wac;
}