You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/endpoints.adoc
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -455,7 +455,7 @@ For example, `@WebEndpoint` is exposed only over HTTP and not over JMX.
455
455
You can write technology-specific extensions by using `@EndpointWebExtension` and `@EndpointJmxExtension`.
456
456
These annotations let you provide technology-specific operations to augment an existing endpoint.
457
457
458
-
Finally, if you need access to web-framework-specific functionality, you can implement Servlet or Spring `@Controller` and `@RestController` endpoints at the cost of them not being available over JMX or when using a different web framework.
458
+
Finally, if you need access to web-framework-specific functionality, you can implement servlet or Spring `@Controller` and `@RestController` endpoints at the cost of them not being available over JMX or when using a different web framework.
459
459
460
460
461
461
@@ -598,9 +598,9 @@ The latter is typically used to perform authorization checks by using its `isUse
If you need to test an auto-configuration that only operates in a Servlet or Reactive web application context, use the `WebApplicationContextRunner` or `ReactiveWebApplicationContextRunner` respectively.
193
+
If you need to test an auto-configuration that only operates in a servlet or reactive web application context, use the `WebApplicationContextRunner` or `ReactiveWebApplicationContextRunner` respectively.
Testing within a mocked environment is usually faster than running with a full Servlet container.
196
-
However, since mocking occurs at the Spring MVC layer, code that relies on lower-level Servlet container behavior cannot be directly tested with MockMvc.
195
+
Testing within a mocked environment is usually faster than running with a full servlet container.
196
+
However, since mocking occurs at the Spring MVC layer, code that relies on lower-level servlet container behavior cannot be directly tested with MockMvc.
197
197
198
-
For example, Spring Boot's error handling is based on the "`error page`" support provided by the Servlet container.
198
+
For example, Spring Boot's error handling is based on the "`error page`" support provided by the servlet container.
199
199
This means that, whilst you can test your MVC layer throws and handles exceptions as expected, you cannot directly test that a specific <<web#web.servlet.spring-mvc.error-handling.error-pages, custom error page>> is rendered.
200
200
If you need to test these lower-level concerns, you can start a fully running server as described in the next section.
201
201
====
@@ -708,7 +708,7 @@ It can also be used to configure the host, scheme, and port that appears in any
===== Auto-configured Spring REST Docs Tests with Mock MVC
711
-
`@AutoConfigureRestDocs` customizes the `MockMvc` bean to use Spring REST Docs when testing Servlet-based web applications.
711
+
`@AutoConfigureRestDocs` customizes the `MockMvc` bean to use Spring REST Docs when testing servlet-based web applications.
712
712
You can inject it by using `@Autowired` and use it in your tests as you normally would when using Mock MVC and Spring REST Docs, as shown in the following example:
To use Jersey alongside another web framework, such as Spring MVC, it should be configured so that it will allow the other framework to handle requests that it cannot handle.
24
-
First, configure Jersey to use a Filter rather than a Servlet by configuring the configprop:spring.jersey.type[] application property with a value of `filter`.
24
+
First, configure Jersey to use a filter rather than a servlet by configuring the configprop:spring.jersey.type[] application property with a value of `filter`.
25
25
Second, configure your `ResourceConfig` to forward requests that would have resulted in a 404, as shown in the following example.
Copy file name to clipboardExpand all lines: spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto/spring-mvc.adoc
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -141,7 +141,7 @@ See the {spring-boot-autoconfigure-module-code}/web/servlet/WebMvcAutoConfigurat
141
141
142
142
[[howto.spring-mvc.multipart-file-uploads]]
143
143
=== Handling Multipart File Uploads
144
-
Spring Boot embraces the Servlet 3 `javax.servlet.http.Part` API to support uploading files.
144
+
Spring Boot embraces the servlet 3 `javax.servlet.http.Part` API to support uploading files.
145
145
By default, Spring Boot configures Spring MVC with a maximum size of 1MB per file and a maximum of 10MB of file data in a single request.
146
146
You may override these values, the location to which intermediate data is stored (for example, to the `/tmp` directory), and the threshold past which data is flushed to disk by using the properties exposed in the `MultipartProperties` class.
147
147
For example, if you want to specify that files be unlimited, set the configprop:spring.servlet.multipart.max-file-size[] property to `-1`.
Copy file name to clipboardExpand all lines: spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto/traditional-deployment.adoc
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -8,10 +8,10 @@ This section answers common questions about traditional deployment.
8
8
[[howto.traditional-deployment.war]]
9
9
=== Create a Deployable War File
10
10
11
-
WARNING: Because Spring WebFlux does not strictly depend on the Servlet API and applications are deployed by default on an embedded Reactor Netty server, War deployment is not supported for WebFlux applications.
11
+
WARNING: Because Spring WebFlux does not strictly depend on the servlet API and applications are deployed by default on an embedded Reactor Netty server, War deployment is not supported for WebFlux applications.
12
12
13
13
The first step in producing a deployable war file is to provide a `SpringBootServletInitializer` subclass and override its `configure` method.
14
-
Doing so makes use of Spring Framework's Servlet 3.0 support and lets you configure your application when it is launched by the servlet container.
14
+
Doing so makes use of Spring Framework's servlet 3.0 support and lets you configure your application when it is launched by the servlet container.
15
15
Typically, you should update your application's main class to extend `SpringBootServletInitializer`, as shown in the following example:
Copy file name to clipboardExpand all lines: spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto/webserver.adoc
+9-9Lines changed: 9 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -41,8 +41,8 @@ The following Maven example shows how to exclude Tomcat and include Jetty for Sp
41
41
</dependency>
42
42
----
43
43
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
-
If you wish to use Jetty 10, which does support Servlet 4.0, override the `jetty.version` property rather than the `servlet-api.version` property.
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
+
If you wish to use Jetty 10, which does support servlet 4.0, override the `jetty.version` property rather than the `servlet-api.version` property.
46
46
47
47
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:
48
48
@@ -239,9 +239,9 @@ See the list of <<application-properties#application-properties>>.
239
239
240
240
The previous sections covered already many common use cases, such as compression, SSL or HTTP/2.
241
241
However, if a configuration key doesn't exist for your use case, you should then look at {spring-boot-module-api}/web/server/WebServerFactoryCustomizer.html[`WebServerFactoryCustomizer`].
242
-
You can declare such a component and get access to the server factory relevant to your choice: you should select the variant for the chosen Server (Tomcat, Jetty, Reactor Netty, Undertow) and the chosen web stack (Servlet or Reactive).
242
+
You can declare such a component and get access to the server factory relevant to your choice: you should select the variant for the chosen Server (Tomcat, Jetty, Reactor Netty, Undertow) and the chosen web stack (servlet or reactive).
243
243
244
-
The example below is for Tomcat with the `spring-boot-starter-web` (Servlet stack):
244
+
The example below is for Tomcat with the `spring-boot-starter-web` (servlet stack):
245
245
246
246
[source,java,indent=0,subs="verbatim"]
247
247
----
@@ -293,21 +293,21 @@ In a servlet stack application, i.e. with the `spring-boot-starter-web`, there a
==== Add a Servlet, Filter, or Listener by Using a Spring Bean
296
-
To add a `Servlet`, `Filter`, or Servlet `*Listener` by using a Spring bean, you must provide a `@Bean` definition for it.
296
+
To add a `Servlet`, `Filter`, or servlet `*Listener` by using a Spring bean, you must provide a `@Bean` definition for it.
297
297
Doing so can be very useful when you want to inject configuration or dependencies.
298
298
However, you must be very careful that they do not cause eager initialization of too many other beans, because they have to be installed in the container very early in the application lifecycle.
299
299
(For example, it is not a good idea to have them depend on your `DataSource` or JPA configuration.)
300
300
You can work around such restrictions by initializing the beans lazily when first used instead of on initialization.
301
301
302
-
In the case of `Filters` and `Servlets`, you can also add mappings and init parameters by adding a `FilterRegistrationBean` or a `ServletRegistrationBean` instead of or in addition to the underlying component.
302
+
In the case of filters and servlets, you can also add mappings and init parameters by adding a `FilterRegistrationBean` or a `ServletRegistrationBean` instead of or in addition to the underlying component.
303
303
304
304
[NOTE]
305
305
====
306
306
If no `dispatcherType` is specified on a filter registration, `REQUEST` is used.
307
-
This aligns with the Servlet Specification's default dispatcher type.
307
+
This aligns with the servlet specification's default dispatcher type.
308
308
====
309
309
310
-
Like any other Spring bean, you can define the order of Servlet filter beans; please make sure to check the "`<<web#web.servlet.embedded-container.servlets-filters-listeners.beans>>`" section.
310
+
Like any other Spring bean, you can define the order of servlet filter beans; please make sure to check the "`<<web#web.servlet.embedded-container.servlets-filters-listeners.beans>>`" section.
311
311
312
312
313
313
@@ -393,7 +393,7 @@ If the proxy adds the commonly used `X-Forwarded-For` and `X-Forwarded-Proto` he
393
393
With this option, the Web servers themselves natively support this feature; you can check their specific documentation to learn about specific behavior.
394
394
395
395
If this is not enough, Spring Framework provides a {spring-framework-docs}/web.html#filters-forwarded-headers[ForwardedHeaderFilter].
396
-
You can register it as a Servlet Filter in your application by setting `server.forward-headers-strategy` is set to `FRAMEWORK`.
396
+
You can register it as a servlet filter in your application by setting `server.forward-headers-strategy` is set to `FRAMEWORK`.
397
397
398
398
TIP: If you are using Tomcat and terminating SSL at the proxy, configprop:server.tomcat.redirect-context-root[] should be set to `false`.
399
399
This allows the `X-Forwarded-Proto` header to be honored before any redirects are performed.
Copy file name to clipboardExpand all lines: spring-boot-project/spring-boot-docs/src/docs/asciidoc/web/graceful-shutdown.adoc
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
[[web.graceful-shutdown]]
2
2
== Graceful Shutdown
3
-
Graceful shutdown is supported with all four embedded web servers (Jetty, Reactor Netty, Tomcat, and Undertow) and with both reactive and Servlet-based web applications.
3
+
Graceful shutdown is supported with all four embedded web servers (Jetty, Reactor Netty, Tomcat, and Undertow) and with both reactive and servlet-based web applications.
4
4
It occurs as part of closing the application context and is performed in the earliest phase of stopping `SmartLifecycle` beans.
5
5
This stop processing uses a timeout which provides a grace period during which existing requests will be allowed to complete but no new requests will be permitted.
6
6
The exact way in which new requests are not permitted varies depending on the web server that is being used.
Copy file name to clipboardExpand all lines: spring-boot-project/spring-boot-docs/src/docs/asciidoc/web/reactive.adoc
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ Spring Boot simplifies development of reactive web applications by providing aut
5
5
[[web.reactive.webflux]]
6
6
=== The "`Spring WebFlux Framework`"
7
7
Spring WebFlux is the new reactive web framework introduced in Spring Framework 5.0.
8
-
Unlike Spring MVC, it does not require the Servlet API, is fully asynchronous and non-blocking, and implements the https://www.reactive-streams.org/[Reactive Streams] specification through https://projectreactor.io/[the Reactor project].
8
+
Unlike Spring MVC, it does not require the servlet API, is fully asynchronous and non-blocking, and implements the https://www.reactive-streams.org/[Reactive Streams] specification through https://projectreactor.io/[the Reactor project].
9
9
10
10
Spring WebFlux comes in two flavors: functional and annotation-based.
11
11
The annotation-based one is quite close to the Spring MVC model, as shown in the following example:
@@ -120,7 +120,7 @@ So, if there is an `index.html` in any of your locations on startup, it is the h
120
120
In addition to the "`standard`" static resource locations listed earlier, a special case is made for https://www.webjars.org/[Webjars content].
121
121
Any resources with a path in `+/webjars/**+` are served from jar files if they are packaged in the Webjars format.
122
122
123
-
TIP: Spring WebFlux applications do not strictly depend on the Servlet API, so they cannot be deployed as war files and do not use the `src/main/webapp` directory.
123
+
TIP: Spring WebFlux applications do not strictly depend on the servlet API, so they cannot be deployed as war files and do not use the `src/main/webapp` directory.
0 commit comments