Add NoHandlerFoundException to DispatcherServlet

Prior to this commit, the DispatcherServlet would send an error
response using the HttpServlet API when no Handler was found to
handle this request.

Now the DispatcherServlet can be configured to throw a
NoHandlerFoundException, when the throwExceptionIfNoHandlerFound
property is set to "true".
Those exceptions can be later on caught by default or custom
HandlerExceptionResolvers/ExceptionHandlers.

Issue: SPR-10481
This commit is contained in:
Brian Clozel
2013-09-24 15:44:58 +02:00
committed by Rossen Stoyanchev
parent 4ef490621f
commit 62d6a43c61
8 changed files with 191 additions and 5 deletions

View File

@@ -4244,6 +4244,12 @@ public class SimpleController {
<entry>400 (Bad Request)</entry>
</row>
<row>
<entry><classname>NoHandlerFoundException</classname></entry>
<entry>404 (Not Found)</entry>
</row>
<row>
<entry><classname>NoSuchRequestHandlingMethodException</classname></entry>