|
1 | 1 | /*
|
2 |
| - * Copyright 2002-2024 the original author or authors. |
| 2 | + * Copyright 2002-2025 the original author or authors. |
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
5 | 5 | * you may not use this file except in compliance with the License.
|
|
51 | 51 | import org.springframework.web.servlet.NoHandlerFoundException;
|
52 | 52 | import org.springframework.web.servlet.handler.AbstractHandlerExceptionResolver;
|
53 | 53 | import org.springframework.web.servlet.resource.NoResourceFoundException;
|
54 |
| -import org.springframework.web.util.DisconnectedClientHelper; |
55 | 54 | import org.springframework.web.util.WebUtils;
|
56 | 55 |
|
57 | 56 | /**
|
|
149 | 148 | * @author Arjen Poutsma
|
150 | 149 | * @author Rossen Stoyanchev
|
151 | 150 | * @author Juergen Hoeller
|
| 151 | + * @author Yanming Zhou |
152 | 152 | * @since 3.0
|
153 | 153 | * @see org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler
|
154 | 154 | */
|
@@ -246,9 +246,6 @@ else if (ex instanceof AsyncRequestNotUsableException) {
|
246 | 246 | return handleAsyncRequestNotUsableException(
|
247 | 247 | (AsyncRequestNotUsableException) ex, request, response, handler);
|
248 | 248 | }
|
249 |
| - else if (DisconnectedClientHelper.isClientDisconnectedException(ex)) { |
250 |
| - return handleDisconnectedClientException(ex, request, response, handler); |
251 |
| - } |
252 | 249 | }
|
253 | 250 | catch (Exception handlerEx) {
|
254 | 251 | if (logger.isWarnEnabled()) {
|
@@ -505,26 +502,6 @@ protected ModelAndView handleAsyncRequestNotUsableException(AsyncRequestNotUsabl
|
505 | 502 | return new ModelAndView();
|
506 | 503 | }
|
507 | 504 |
|
508 |
| - /** |
509 |
| - * Handle an Exception that indicates the client has gone away. This is |
510 |
| - * typically an {@link IOException} of a specific subtype or with a message |
511 |
| - * specific to the underlying Servlet container. Those are detected through |
512 |
| - * {@link DisconnectedClientHelper#isClientDisconnectedException(Throwable)} |
513 |
| - * <p>By default, do nothing since the response is not usable. |
514 |
| - * @param ex the {@code Exception} to be handled |
515 |
| - * @param request current HTTP request |
516 |
| - * @param response current HTTP response |
517 |
| - * @param handler the executed handler, or {@code null} if none chosen |
518 |
| - * at the time of the exception (for example, if multipart resolution failed) |
519 |
| - * @return an empty ModelAndView indicating the exception was handled |
520 |
| - * @since 6.2 |
521 |
| - */ |
522 |
| - protected ModelAndView handleDisconnectedClientException( |
523 |
| - Exception ex, HttpServletRequest request, HttpServletResponse response, @Nullable Object handler) { |
524 |
| - |
525 |
| - return new ModelAndView(); |
526 |
| - } |
527 |
| - |
528 | 505 | /**
|
529 | 506 | * Handle an {@link ErrorResponse} exception.
|
530 | 507 | * <p>The default implementation sets status and the headers of the response
|
|
0 commit comments