spring-projects / spring-projects/spring-data-rest
Allow user to order rest handler mapping [DATAREST-896]
@odrotbohm is already working on this.
Since Dec 31, 2020.
- Dominant language
- Java
- Stars
- 958
- Forks
- 568
- PR merge metrics
- No merged PRs in 30d
Description
Petar Tahchiev opened DATAREST-896 and commented
As indicated here
the RequestMappingHandlerMapping has order 0.
At the moment DelegatingHandlerMapping is registered with Ordered.LOWEST_PRECEDENCE - 100; so it is always after RequestMappingHandlerMapping. In a typical spring-boot application I would love to be able to configure the order. The best combination in my oppinion would be:
1) Some custom handler mapping or maybe h2-console?
2) Spring boot actuators
3) Spring data rest handler mapping
4) RequestMappingHanderMapping (has order 0)
5) Static resources
but at the moment it is like this:
1) Some custom handler mapping or maybe h2-console?
2) Spring boot actuators
3) RequestMappingHanderMapping (has order 0)
4) Spring data rest handler mapping
5) Static resources
In my application I have a DefaultController which always kicks in if there's no controller mapping, so I never get to the REST handler mapping.
Affects: 2.5.2 (Hopper SR2), 2.6 M1 (Ingalls)
3 votes, 6 watchers
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.