Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix documentation for configuration of NoHandlerFoundAdviceTrait with Spring Boot >= 2.4.0 #732

Open
markuswaidhofer opened this issue Jan 20, 2022 · 0 comments
Labels

Comments

@markuswaidhofer
Copy link

Description

In the readme file, section configuration, it is documented which Spring Boot properties need to be set to make the NoHandlerFoundAdviceTrait work:

spring:
  resources:
    add-mappings: false
  mvc:
    throw-exception-if-no-handler-found: true

Starting with Spring Boot 2.4.0, spring.resources.* properties were moved to spring.web.resources.*: spring-projects/spring-boot#23917

The documentation should be updated to reflect this change (ideally mention different properties based on Spring boot versions).

I ran into this issue when upgrading Spring boot. Moving the property to spring.web.resources.add-mappings made NoHandlerFoundAdviceTrait work again.

I double checked this with the reference documentation:

  • 2.3.x - property was named spring.resources.add-mappings
  • 2.4.0 - property renamed to spring.web.resources.add-mappings

Possible Fix

Update documentation to mention that Spring boot >= 2.4.0 requires these properties:

spring:
  web:
    resources:
      add-mappings: false
  mvc:
    throw-exception-if-no-handler-found: true

I am happy to help here and make a PR if this is fine (first time contributer here 👋).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant