Skip to content

Commit de2335b

Browse files
committed
Merge branch '6.1.x'
2 parents fc28926 + 9aac24c commit de2335b

File tree

4 files changed

+67
-32
lines changed

4 files changed

+67
-32
lines changed

framework-docs/framework-docs.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ dependencies {
4949
api(project(":spring-jms"))
5050
api(project(":spring-test"))
5151
api(project(":spring-web"))
52+
api(project(":spring-webflux"))
5253
api(project(":spring-webmvc"))
5354
api(project(":spring-websocket"))
5455

framework-docs/modules/ROOT/pages/web/webflux/config.adoc

+1-32
Original file line numberDiff line numberDiff line change
@@ -669,38 +669,7 @@ You can customize options related to path matching. For details on the individua
669669
{spring-framework-api}/web/reactive/config/PathMatchConfigurer.html[`PathMatchConfigurer`] javadoc.
670670
The following example shows how to use `PathMatchConfigurer`:
671671

672-
[tabs]
673-
======
674-
Java::
675-
+
676-
[source,java,indent=0,subs="verbatim,quotes",role="primary"]
677-
----
678-
@Configuration
679-
public class WebConfig implements WebFluxConfigurer {
680-
681-
@Override
682-
public void configurePathMatch(PathMatchConfigurer configurer) {
683-
configurer.addPathPrefix(
684-
"/api", HandlerTypePredicate.forAnnotation(RestController.class));
685-
}
686-
}
687-
----
688-
689-
Kotlin::
690-
+
691-
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
692-
----
693-
@Configuration
694-
class WebConfig : WebFluxConfigurer {
695-
696-
@Override
697-
fun configurePathMatch(configurer: PathMatchConfigurer) {
698-
configurer.addPathPrefix(
699-
"/api", HandlerTypePredicate.forAnnotation(RestController::class.java))
700-
}
701-
}
702-
----
703-
======
672+
include-code::./WebConfig[]
704673

705674
[TIP]
706675
====
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*
2+
* Copyright 2002-2024 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package org.springframework.docs.web.webflux.webfluxconfigpathmatching;
18+
19+
import org.springframework.context.annotation.Configuration;
20+
import org.springframework.web.bind.annotation.RestController;
21+
import org.springframework.web.method.HandlerTypePredicate;
22+
import org.springframework.web.reactive.config.PathMatchConfigurer;
23+
import org.springframework.web.reactive.config.WebFluxConfigurer;
24+
25+
@Configuration
26+
public class WebConfig implements WebFluxConfigurer {
27+
28+
@Override
29+
public void configurePathMatching(PathMatchConfigurer configurer) {
30+
configurer.addPathPrefix(
31+
"/api", HandlerTypePredicate.forAnnotation(RestController.class));
32+
}
33+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*
2+
* Copyright 2002-2024 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package org.springframework.docs.web.webflux.webfluxconfigpathmatching
18+
19+
import org.springframework.context.annotation.Configuration
20+
import org.springframework.web.bind.annotation.RestController
21+
import org.springframework.web.method.HandlerTypePredicate
22+
import org.springframework.web.reactive.config.PathMatchConfigurer
23+
import org.springframework.web.reactive.config.WebFluxConfigurer
24+
25+
@Configuration
26+
class WebConfig : WebFluxConfigurer {
27+
28+
override fun configurePathMatching(configurer: PathMatchConfigurer) {
29+
configurer.addPathPrefix(
30+
"/api", HandlerTypePredicate.forAnnotation(RestController::class.java))
31+
}
32+
}

0 commit comments

Comments
 (0)