Go to file
Brian Clozel 1a34b0dd87 Improve PathMatcher/PatternParser XML configuration
Prior to this commit, the MVC namespace for the XML Spring configuration
model would use the `PathMatcher` bean instance when provided like this:

```
<bean id="pathMatcher" class="org.springframework.util.AntPathMatcher"/>
<mvc:annotation-driven>
  <mvc:path-matching path-matcher="pathMatcher"/>
</mvc:annotation-driven>
<mvc:resources mapping="/resources/**" location="classpath:/static/"/>
```

With this configuration, the handler mapping for annotated controller
would use the given `AntPathMatcher` instance but the handler mapping
for resources would still use the default, which is `PathPatternParser`
since 6.0.

This commit ensures that when a custom `path-matcher` is defined, it's
consistently used for all MVC handler mappings as an alias to the
well-known bean name. This allows to use `AntPathMatcher` consistently
while working on a migration path to `PathPatternParser`

This commit also adds a new XML attribute to the path matching
configuration that makes it possible to use a custom `PathPatternParser`
instance:

```
<bean id="patternParser" class="org.springframework.web.util.pattern.PathPatternParser"/>
<mvc:annotation-driven>
  <mvc:path-matching pattern-parser="patternParser"/>
</mvc:annotation-driven>
```

Closes gh-34064
2024-12-17 10:14:18 +01:00
.github Polish "Prevent execution of Antora jobs on forks" 2024-12-12 17:35:38 +01:00
buildSrc Upgrade to Jackson 2.18.2, RxJava 3.1.10, Checkstyle 10.20.2 2024-12-11 17:34:53 +01:00
framework-api Fix warning in doc generation 2024-07-23 15:06:59 +02:00
framework-bom Guard against new Spring modules in ApiDiff task 2022-07-28 10:51:53 +02:00
framework-docs Add note about using @EventListener on lazy beans 2024-12-12 17:32:18 +01:00
framework-platform Upgrade to JUnit 5.11.4 2024-12-16 14:42:30 +01:00
gradle Upgrade to Gradle 8.11.1 2024-11-24 14:27:39 +01:00
integration-tests Merge branch '6.1.x' 2024-11-05 10:27:22 +01:00
spring-aop Use JDK proxy for introduction interface without target 2024-12-04 21:03:09 +01:00
spring-aspects Merge branch '6.1.x' 2024-10-28 22:12:12 +01:00
spring-beans Log alias removal in DefaultListableBeanFactory 2024-12-11 15:03:52 +01:00
spring-context Fix custom scheduler support for @Scheduled methods 2024-12-10 22:33:20 +01:00
spring-context-indexer Polish 2024-01-17 18:41:15 +01:00
spring-context-support (Re)suppress deprecation warnings 2024-10-30 10:52:01 +01:00
spring-core Consistently handle generics in TypeDescriptor.equals 2024-12-10 22:16:10 +01:00
spring-core-test Merge branch '6.1.x' 2024-11-06 23:12:06 +09:00
spring-expression Document support for varargs invocations in SpEL 2024-11-18 11:54:22 +01:00
spring-instrument Ensure all packages declare package-info.java with null-safety annotations 2023-03-10 17:33:52 +01:00
spring-jcl Replace 'e.g.' with 'for example' in documentation and comments 2024-09-26 14:11:17 +02:00
spring-jdbc Polish 2024-12-10 07:47:42 +01:00
spring-jms Refer to message "receipt" instead of "reception" 2024-11-19 13:18:12 +01:00
spring-messaging Avoid deprecated ListenableFuture name for internal class 2024-12-11 17:34:48 +01:00
spring-orm Avoid logger serialization behind shared EntityManager proxy 2024-12-12 19:48:21 +01:00
spring-oxm Document XML parser usage against security false positives 2024-10-15 18:59:02 +02:00
spring-r2dbc Replace 'e.g.' with 'for example' in documentation and comments 2024-09-26 14:11:17 +02:00
spring-test Polish Javadoc for BeanOverrideHandler 2024-12-12 14:41:23 +01:00
spring-tx Revert "Reuse NoTransactionInContextException instances" 2024-12-10 11:47:56 +01:00
spring-web Polishing 2024-12-11 17:52:59 +01:00
spring-webflux Support header filtering in web data binding 2024-12-11 16:11:22 +00:00
spring-webmvc Improve PathMatcher/PatternParser XML configuration 2024-12-17 10:14:18 +01:00
spring-websocket Avoid javadoc references to deprecated types/methods 2024-12-11 16:58:37 +01:00
src Merge branch '6.1.x' 2024-11-01 10:42:51 +01:00
.editorconfig Add EditorConfig 2017-06-12 08:07:54 +02:00
.gitattributes Ensure line endings for binary files are not modified in Git 2019-10-18 11:56:18 +02:00
.gitignore Modernize Antora Build 2024-05-22 10:20:20 +02:00
.sdkmanrc Upgrade to Java 17.0.12 2024-08-04 09:34:13 +02:00
CONTRIBUTING.md Replace 'e.g.' with 'for example' in documentation and comments 2024-09-26 14:11:17 +02:00
LICENSE.txt Add LICENSE.txt file 2019-08-20 22:01:12 +02:00
README.md Fix link to code of conduct 2024-10-08 14:03:54 +02:00
SECURITY.md Update SECURITY.md 2024-10-15 17:13:29 +01:00
build.gradle Upgrade to JUnit 5.11.4 2024-12-16 14:42:30 +01:00
gradle.properties Next development version (v6.2.2-SNAPSHOT) 2024-12-12 10:53:14 +01:00
gradlew Upgrade to Gradle 8.9 2024-07-14 11:21:52 +02:00
gradlew.bat Upgrade to Gradle 8.9 2024-07-14 11:21:52 +02:00
import-into-eclipse.md Remove Groovy from "Eclipse/STS Project Import Guide" 2022-01-21 11:27:09 +01:00
import-into-idea.md Fix links in Javadoc and reference docs 2022-09-14 17:00:11 +02:00
settings.gradle Fix build warnings 2024-04-30 19:10:31 +02:00
update_copyright_headers.sh Use correct Kotlin file extension in update_copyright_headers.sh 2023-02-19 13:41:36 +01:00

README.md

Spring Framework Build Status Revved up by Develocity

This is the home of the Spring Framework: the foundation for all Spring projects. Collectively the Spring Framework and the family of Spring projects are often referred to simply as "Spring".

Spring provides everything required beyond the Java programming language for creating enterprise applications for a wide range of scenarios and architectures. Please read the Overview section of the reference documentation for a more complete introduction.

Code of Conduct

This project is governed by the Spring Code of Conduct. By participating, you are expected to uphold this code of conduct. Please report unacceptable behavior to spring-code-of-conduct@spring.io.

Access to Binaries

For access to artifacts or a distribution zip, see the Spring Framework Artifacts wiki page.

Documentation

The Spring Framework maintains reference documentation (published and source), GitHub wiki pages, and an API reference. There are also guides and tutorials across Spring projects.

Micro-Benchmarks

See the Micro-Benchmarks wiki page.

Build from Source

See the Build from Source wiki page and the CONTRIBUTING.md file.

Continuous Integration Builds

Information regarding CI builds can be found in the Spring Framework Concourse pipeline documentation.

Stay in Touch

Follow @SpringCentral, @SpringFramework, and its team members on 𝕏. In-depth articles can be found at The Spring Blog, and releases are announced via our releases feed.

License

The Spring Framework is released under version 2.0 of the Apache License.