Support Tomcat 9 and Undertow 2
Closes gh-11749 Closes gh-12243
This commit is contained in:
@@ -51,14 +51,14 @@ Spring Boot supports the following embedded servlet containers:
|
||||
|===
|
||||
|Name |Servlet Version
|
||||
|
||||
|Tomcat 8.5
|
||||
|3.1
|
||||
|Tomcat 9.0
|
||||
|4.0
|
||||
|
||||
|Jetty 9.4
|
||||
|3.1
|
||||
|
||||
|Undertow 1.4
|
||||
|3.1
|
||||
|Undertow 2.0
|
||||
|4.0
|
||||
|===
|
||||
|
||||
You can also deploy Spring Boot applications to any Servlet 3.1+ compatible container.
|
||||
|
||||
@@ -523,6 +523,9 @@ The following Maven example shows how to exclude Tomcat and include Jetty for Sp
|
||||
|
||||
[source,xml,indent=0,subs="verbatim,quotes,attributes"]
|
||||
----
|
||||
<properties>
|
||||
<servlet-api.version>3.1.0</servlet-api.version>
|
||||
</properties>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
@@ -541,6 +544,9 @@ The following Maven example shows how to exclude Tomcat and include Jetty for Sp
|
||||
</dependency>
|
||||
----
|
||||
|
||||
NOTE: The version of the Servlet API has been overridden as, unlike Tomcat 9 and Undertow
|
||||
2.0, Jetty 9.4 does not support Servlet 4.0.
|
||||
|
||||
The following Gradle example shows how to exclude Netty and include Undertow for Spring
|
||||
WebFlux:
|
||||
|
||||
@@ -727,16 +733,16 @@ To enable that support, your application needs to have two additional dependenci
|
||||
|
||||
[[howto-configure-http2-tomcat]]
|
||||
==== HTTP/2 with Tomcat
|
||||
Spring Boot ships by default with Tomcat 8.5.x. With that version, HTTP/2 is only
|
||||
supported if the `libtcnative` library and its dependencies are installed on the host
|
||||
operating system.
|
||||
Spring Boot ships by default with Tomcat 9.0.x which supports HTTP/2 out of the box when
|
||||
using JDK 9 or later. Alternatively, HTTP/2 can be used on JDK 8 if the `libtcnative`
|
||||
library and its dependencies are installed on the host operating system.
|
||||
|
||||
The library folder must be made available, if not already, to the JVM library path. You
|
||||
can do so with a JVM argument such as
|
||||
`-Djava.library.path=/usr/local/opt/tomcat-native/lib`. More on this in the
|
||||
https://tomcat.apache.org/tomcat-8.5-doc/apr.html[official Tomcat documentation].
|
||||
https://tomcat.apache.org/tomcat-9.0-doc/apr.html[official Tomcat documentation].
|
||||
|
||||
Starting Tomcat 8.5.x without that native support logs the following error:
|
||||
Starting Tomcat 9.0.x on JDK 8 without that native support logs the following error:
|
||||
|
||||
[indent=0,subs="attributes"]
|
||||
----
|
||||
@@ -745,10 +751,6 @@ Starting Tomcat 8.5.x without that native support logs the following error:
|
||||
|
||||
This error is not fatal, and the application still starts with HTTP/1.1 SSL support.
|
||||
|
||||
Running your application with Tomcat 9.0.x and JDK9 does not require any native library to
|
||||
be installed. To use Tomcat 9, you can override the `tomcat.version` build property with
|
||||
the version of your choice.
|
||||
|
||||
|
||||
|
||||
[[howto-configure-webserver]]
|
||||
|
||||
@@ -7409,9 +7409,9 @@ include::{test-examples}/web/client/SampleWebClientTests.java[tag=test]
|
||||
|
||||
[[boot-features-websockets]]
|
||||
== WebSockets
|
||||
Spring Boot provides WebSockets auto-configuration for embedded Tomcat 8.5, Jetty
|
||||
9, and Undertow. If you deploy a war file to a standalone container, Spring Boot assumes
|
||||
that the container is responsible for the configuration of its WebSocket support.
|
||||
Spring Boot provides WebSockets auto-configuration for embedded Tomcat, Jetty, and
|
||||
Undertow. If you deploy a war file to a standalone container, Spring Boot assumes that the
|
||||
container is responsible for the configuration of its WebSocket support.
|
||||
|
||||
Spring Framework provides {spring-reference}web.html#websocket[rich WebSocket support]
|
||||
that can be easily accessed through the `spring-boot-starter-websocket` module.
|
||||
|
||||
Reference in New Issue
Block a user