File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -469,6 +469,19 @@ initialization parameters ( `init-param` elements) to the Servlet declaration in
469
469
470
470
| `namespace`
471
471
| Namespace of the `WebApplicationContext`. Defaults to `[servlet-name]-servlet`.
472
+
473
+ | `throwExceptionIfNoHandlerFound`
474
+ | Whether to throw a `NoHandlerFoundException` when no handler was found for a request.
475
+ The exception can then be caught with a `HandlerExceptionResolver`, e.g. via an
476
+ `@ExceptionHandler` controller method, and handled as any others.
477
+
478
+ By default this is set to "false", in which case the `DispatcherServlet` sets the
479
+ response status to 404 (NOT_FOUND) without raising an exception.
480
+
481
+ Note that if <<mvc-default-servlet-handler,default servlet handling>> is
482
+ also configured, then unresolved requests are always forwarded to the default servlet
483
+ and a 404 would never be raised.
484
+
472
485
|===
473
486
474
487
You can’t perform that action at this time.
0 commit comments