Skip to content

Commit b4721c9

Browse files
committed
Update "Use Another Web Server" documentation
Closes gh-37238
1 parent 87742e8 commit b4721c9

File tree

1 file changed

+2
-40
lines changed
  • spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto

1 file changed

+2
-40
lines changed

spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto/webserver.adoc

Lines changed: 2 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ The following Maven example shows how to exclude Tomcat and include Jetty for Sp
2121
[source,xml,indent=0,subs="verbatim"]
2222
----
2323
<properties>
24-
<servlet-api.version>3.1.0</servlet-api.version>
24+
<jakarta-servlet.version>5.0.0</jakarta-servlet.version>
2525
</properties>
2626
<dependency>
2727
<groupId>org.springframework.boot</groupId>
@@ -41,45 +41,7 @@ The following Maven example shows how to exclude Tomcat and include Jetty for Sp
4141
</dependency>
4242
----
4343

44-
NOTE: The version of the servlet API has been overridden as, unlike Tomcat 9 and Undertow 2, Jetty 9.4 does not support servlet 4.0.
45-
46-
If you wish to use Jetty 10, which does support servlet 4.0, you can do so as shown in the following example:
47-
48-
[source,xml,indent=0,subs="verbatim"]
49-
----
50-
<properties>
51-
<jetty.version>10.0.8</jetty.version>
52-
</properties>
53-
<dependency>
54-
<groupId>org.springframework.boot</groupId>
55-
<artifactId>spring-boot-starter-web</artifactId>
56-
<exclusions>
57-
<!-- Exclude the Tomcat dependency -->
58-
<exclusion>
59-
<groupId>org.springframework.boot</groupId>
60-
<artifactId>spring-boot-starter-tomcat</artifactId>
61-
</exclusion>
62-
</exclusions>
63-
</dependency>
64-
<!-- Use Jetty instead -->
65-
<dependency>
66-
<groupId>org.springframework.boot</groupId>
67-
<artifactId>spring-boot-starter-jetty</artifactId>
68-
<exclusions>
69-
<!-- Exclude the Jetty-9 specific dependencies -->
70-
<exclusion>
71-
<groupId>org.eclipse.jetty.websocket</groupId>
72-
<artifactId>websocket-server</artifactId>
73-
</exclusion>
74-
<exclusion>
75-
<groupId>org.eclipse.jetty.websocket</groupId>
76-
<artifactId>javax-websocket-server-impl</artifactId>
77-
</exclusion>
78-
</exclusions>
79-
</dependency>
80-
----
81-
82-
Note that along with excluding the Tomcat starter, a couple of Jetty9-specific dependencies also need to be excluded.
44+
NOTE: The version of the Jakarta Servlet API has been overridden as, unlike Tomcat 10 and Undertow 2.3, Jetty 11 does not support Servlet 6.0.
8345

8446
The following Gradle example configures the necessary dependencies and a {gradle-docs}/resolution_rules.html#sec:module_replacement[module replacement] to use Undertow in place of Reactor Netty for Spring WebFlux:
8547

0 commit comments

Comments
 (0)