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: docs/modules/ROOT/pages/servlet/integrations/mvc.adoc
+16-14
Original file line number
Diff line number
Diff line change
@@ -199,12 +199,10 @@ We could add additional rules for all the permutations of Spring MVC, but this w
199
199
Fortunately, when using the `requestMatchers` DSL method, Spring Security automatically creates a `MvcRequestMatcher` if it detects that Spring MVC is available in the classpath.
200
200
Therefore, it will protect the same URLs that Spring MVC will match on by using Spring MVC to match on the URL.
201
201
202
-
One common requirement when using Spring MVC is to specify the servlet path property, for that you can use the `MvcRequestMatcher.Builder` to create multiple `MvcRequestMatcher` instances that share the same servlet path:
202
+
One common requirement when using Spring MVC is to specify the servlet path property.
203
+
204
+
For Java-based Configuration, you can use the `MvcRequestMatcher.Builder` to create multiple `MvcRequestMatcher` instances that share the same servlet path:
203
205
204
-
[tabs]
205
-
======
206
-
Java::
207
-
+
208
206
[source,java,role="primary"]
209
207
----
210
208
@Bean
@@ -219,32 +217,36 @@ public SecurityFilterChain filterChain(HttpSecurity http, HandlerMappingIntrospe
219
217
}
220
218
----
221
219
220
+
For Kotlin and XML, this happens when you specify the servlet path for each path like so:
221
+
222
+
[tabs]
223
+
======
222
224
Kotlin::
223
225
+
224
226
[source,kotlin,role="secondary"]
225
227
----
226
228
@Bean
227
-
open fun filterChain(http: HttpSecurity, introspector: HandlerMappingIntrospector): SecurityFilterChain {
228
-
val mvcMatcherBuilder = MvcRequestMatcher.Builder(introspector)
229
+
open fun filterChain(http: HttpSecurity): SecurityFilterChain {
0 commit comments