Skip to content

Commit d8545bd

Browse files
committed
Merge branch '2.1.x'
Closes gh-18887
2 parents 571e464 + 8b62f44 commit d8545bd

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

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

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1228,6 +1228,27 @@ include::{code-examples}/jersey/JerseySetStatusOverSendErrorExample.java[tag=res
12281228

12291229

12301230

1231+
[[howto-jersey-alongside-another-web-framework]]
1232+
=== Use Jersey Alongside Another Web Framework
1233+
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.
1234+
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`.
1235+
Second, configure your `ResourceConfig` to forward requests that would have resulted in a 404, as shown in the following example.
1236+
1237+
[source,java,indent=0,subs="verbatim,quotes,attributes"]
1238+
----
1239+
@Component
1240+
public class JerseyConfig extends ResourceConfig {
1241+
1242+
public JerseyConfig() {
1243+
register(Endpoint.class);
1244+
property(ServletProperties.FILTER_FORWARD_ON_404, true);
1245+
}
1246+
1247+
}
1248+
----
1249+
1250+
1251+
12311252
[[howto-http-clients]]
12321253
== HTTP Clients
12331254
Spring Boot offers a number of starters that work with HTTP clients.

spring-boot-project/spring-boot-docs/src/main/asciidoc/production-ready-features.adoc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,7 @@ TIP: See {spring-boot-actuator-autoconfigure-module-code}/endpoint/web/CorsEndpo
443443
=== Implementing Custom Endpoints
444444
If you add a `@Bean` annotated with `@Endpoint`, any methods annotated with `@ReadOperation`, `@WriteOperation`, or `@DeleteOperation` are automatically exposed over JMX and, in a web application, over HTTP as well.
445445
Endpoints can be exposed over HTTP using Jersey, Spring MVC, or Spring WebFlux.
446+
If both Jersey and Spring MVC are available, Spring MVC will be used.
446447

447448
You can also write technology-specific endpoints by using `@JmxEndpoint` or `@WebEndpoint`.
448449
These endpoints are restricted to their respective technologies.
@@ -494,6 +495,7 @@ Before calling an operation method, the input received via JMX or an HTTP reques
494495
[[production-ready-endpoints-custom-web]]
495496
==== Custom Web Endpoints
496497
Operations on an `@Endpoint`, `@WebEndpoint`, or `@EndpointWebExtension` are automatically exposed over HTTP using Jersey, Spring MVC, or Spring WebFlux.
498+
If both Jersey and Spring MVC are available, Spring MVC will be used.
497499

498500

499501

@@ -987,6 +989,7 @@ The default convention is to use the `id` of the endpoint with a prefix of `/act
987989
For example, `health` is exposed as `/actuator/health`.
988990

989991
TIP: Actuator is supported natively with Spring MVC, Spring WebFlux, and Jersey.
992+
If both Jersey and Spring MVC are available, Spring MVC will be used.
990993

991994

992995

0 commit comments

Comments
 (0)