Skip to content

Commit b8e8647

Browse files
committed
Fix Servlet requirements in reference docs
As of Spring Framework 5.0, only Servlet 3.1+ containers are supported. See https://github.com/spring-projects/spring-framework/wiki/Upgrading-to-Spring-Framework-5.x This commit updates the reference documentation to reflect that and also removes sections describing pre-Servlet 3.1 solutions, as those are not supported anymore. Fixes gh-12370
1 parent 2561f32 commit b8e8647

File tree

2 files changed

+1
-73
lines changed

2 files changed

+1
-73
lines changed

spring-boot-project/spring-boot-docs/src/main/asciidoc/getting-started.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Spring Boot supports the following embedded servlet containers:
6161
|3.1
6262
|===
6363

64-
You can also deploy Spring Boot applications to any Servlet 3.0+ compatible container.
64+
You can also deploy Spring Boot applications to any Servlet 3.1+ compatible container.
6565

6666

6767

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

Lines changed: 0 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -2936,14 +2936,6 @@ example] of the previously described configuration.
29362936

29372937

29382938

2939-
[[howto-create-a-deployable-war-file-for-older-containers]]
2940-
=== Create a Deployable War File for Older Servlet Containers
2941-
Older Servlet containers do not have support for the `ServletContextInitializer` bootstrap
2942-
process used in Servlet 3.0. You can still use Spring and Spring Boot in these containers,
2943-
but you are going to need to add a `web.xml` to your application and configure it to load
2944-
an `ApplicationContext` via a `DispatcherServlet`.
2945-
2946-
29472939

29482940
[[howto-convert-an-existing-application-to-spring-boot]]
29492941
=== Convert an Existing Application to Spring Boot
@@ -3110,70 +3102,6 @@ rather than the version that was pre-installed with the server. You can do so by
31103102

31113103

31123104

3113-
[[howto-servlet-2-5]]
3114-
=== Deploying a WAR in an Old (Servlet 2.5) Container
3115-
Spring Boot uses Servlet 3.0 APIs to initialize the `ServletContext` (register `Servlets`
3116-
and so on), so you cannot use the same application in a Servlet 2.5 container.
3117-
It *is*, however, possible to run a Spring Boot application on an older container with some
3118-
special tools. If you include `org.springframework.boot:spring-boot-legacy` as a
3119-
dependency (https://github.com/scratches/spring-boot-legacy[maintained separately] to the
3120-
core of Spring Boot and currently available at 1.1.0.RELEASE), all you need to do
3121-
is create a `web.xml` and declare a context listener to create the application context and
3122-
your filters and servlets. The context listener is a special purpose one for Spring Boot,
3123-
but the rest of it is normal for a Spring application in Servlet 2.5. The following Maven
3124-
example shows how to set up a Spring Boot project to run in a Servlet 2.5 container:
3125-
3126-
[source,xml,indent=0]
3127-
----
3128-
<?xml version="1.0" encoding="UTF-8"?>
3129-
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
3130-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3131-
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
3132-
3133-
<context-param>
3134-
<param-name>contextConfigLocation</param-name>
3135-
<param-value>demo.Application</param-value>
3136-
</context-param>
3137-
3138-
<listener>
3139-
<listener-class>org.springframework.boot.legacy.context.web.SpringBootContextLoaderListener</listener-class>
3140-
</listener>
3141-
3142-
<filter>
3143-
<filter-name>metricsFilter</filter-name>
3144-
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
3145-
</filter>
3146-
3147-
<filter-mapping>
3148-
<filter-name>metricsFilter</filter-name>
3149-
<url-pattern>/*</url-pattern>
3150-
</filter-mapping>
3151-
3152-
<servlet>
3153-
<servlet-name>appServlet</servlet-name>
3154-
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
3155-
<init-param>
3156-
<param-name>contextAttribute</param-name>
3157-
<param-value>org.springframework.web.context.WebApplicationContext.ROOT</param-value>
3158-
</init-param>
3159-
<load-on-startup>1</load-on-startup>
3160-
</servlet>
3161-
3162-
<servlet-mapping>
3163-
<servlet-name>appServlet</servlet-name>
3164-
<url-pattern>/</url-pattern>
3165-
</servlet-mapping>
3166-
3167-
</web-app>
3168-
----
3169-
3170-
In the preceding example, we use a single application context (the one created by the
3171-
context listener) and attach it to the `DispatcherServlet` by using an `init` parameter.
3172-
This is normal in a Spring Boot application (you normally only have one application
3173-
context).
3174-
3175-
3176-
31773105
[[howto-use-jedis-instead-of-lettuce]]
31783106
=== Use Jedis Instead of Lettuce
31793107
By default, the Spring Boot starter (`spring-boot-starter-data-redis`) uses

0 commit comments

Comments
 (0)