diff --git a/src/docs/asciidoc/web/webmvc.adoc b/src/docs/asciidoc/web/webmvc.adoc index 55f924e968cce1a7210fbc4afedb8e7f6c15f8b4..a7f5f3011b99879f74290b7cf94e9a69aeb1d624 100644 --- a/src/docs/asciidoc/web/webmvc.adoc +++ b/src/docs/asciidoc/web/webmvc.adoc @@ -469,6 +469,19 @@ initialization parameters ( `init-param` elements) to the Servlet declaration in | `namespace` | Namespace of the `WebApplicationContext`. Defaults to `[servlet-name]-servlet`. + +| `throwExceptionIfNoHandlerFound` +| Whether to throw a `NoHandlerFoundException` when no handler was found for a request. + The exception can then be caught with a `HandlerExceptionResolver`, e.g. via an + `@ExceptionHandler` controller method, and handled as any others. + + By default this is set to "false", in which case the `DispatcherServlet` sets the + response status to 404 (NOT_FOUND) without raising an exception. + + Note that if <> is + also configured, then unresolved requests are always forwarded to the default servlet + and a 404 would never be raised. + |===