Skip to content

Commit f813079

Browse files
committed
Update docs to reflect new no handler found exception behavior
Closes gh-42164
1 parent 4f57603 commit f813079

File tree

1 file changed

+3
-3
lines changed
  • spring-boot-project/spring-boot-docs/src/docs/asciidoc/web

1 file changed

+3
-3
lines changed

spring-boot-project/spring-boot-docs/src/docs/asciidoc/web/servlet.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -285,10 +285,10 @@ The strategy can be configured using the configprop:spring.mvc.pathmatch.matchin
285285
matching-strategy: "ant-path-matcher"
286286
----
287287

288-
By default, Spring MVC will send a 404 Not Found error response if a handler is not found for a request.
289-
To have a `NoHandlerFoundException` thrown instead, set configprop:spring.mvc.throw-exception-if-no-handler-found to `true`.
288+
Spring MVC will throw a `NoHandlerFoundException` if a handler is not found for a request.
290289
Note that, by default, the <<web#web.servlet.spring-mvc.static-content, serving of static content>> is mapped to `+/**+` and will, therefore, provide a handler for all requests.
291-
For a `NoHandlerFoundException` to be thrown, you must also set configprop:spring.mvc.static-path-pattern[] to a more specific value such as `/resources/**` or set configprop:spring.web.resources.add-mappings[] to `false` to disable serving of static content entirely.
290+
If no static content is available, `ResourceHttpRequestHandler` will throw a `NoResourceFoundException`.
291+
For a `NoHandlerFoundException` to be thrown, set configprop:spring.mvc.static-path-pattern[] to a more specific value such as `/resources/**` or set configprop:spring.web.resources.add-mappings[] to `false` to disable serving of static content entirely.
292292

293293

294294

0 commit comments

Comments
 (0)