Skip to content

Improve migration documentation at "28.1.8 Path Matching and Content Negotiation" #14919

@huberchrigu

Description

@huberchrigu

The Spring Boot migration guide links https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-developing-web-applications.html#boot-features-spring-mvc-pathmatch for migrating MVC endpoints with suffix matching. There the documentation says

Spring Boot chooses to disable suffix pattern matching by default, which means that requests like "GET /projects/spring-boot.json" won’t be matched to @GetMapping("/projects/spring-boot") mappings. ... If you understand the caveats and would still like your application to use suffix pattern matching, the following configuration is required:

spring.mvc.contentnegotiation.favor-path-extension=true
...

That is not accurate, the given example will still not work. I suggest you also mention to add the following property

spring.mvc.pathmatch.use-suffix-pattern=true

Only then it works as with Spring 4.

Metadata

Metadata

Assignees

Labels

status: supersededAn issue that has been superseded by another

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions