From d955549037e632b76c7b716855bffcd673ffda04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Nicoll?= Date: Thu, 4 Apr 2024 14:30:39 +0200 Subject: [PATCH] Clarify scope of exception See gh-29491 --- .../web/servlet/NoHandlerFoundException.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/NoHandlerFoundException.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/NoHandlerFoundException.java index 99362952fe4b..22ba7647b133 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/NoHandlerFoundException.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/NoHandlerFoundException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,14 +27,11 @@ import org.springframework.web.ErrorResponse; /** - * By default, when the DispatcherServlet can't find a handler for a request it - * sends a 404 response. However, if its property "throwExceptionIfNoHandlerFound" - * is set to {@code true} this exception is raised and may be handled with - * a configured HandlerExceptionResolver. + * Thrown when the {@link DispatcherServlet} can't find a handler for a request, + * which may be handled with a configured {@link HandlerExceptionResolver}. * * @author Brian Clozel * @since 4.0 - * @see DispatcherServlet#setThrowExceptionIfNoHandlerFound(boolean) * @see DispatcherServlet#noHandlerFound(HttpServletRequest, HttpServletResponse) */ @SuppressWarnings("serial")