title: Best way to chain @Exceptionhandler from PUT method Handler?
body: <p>I'm implementing Exception handling.</p>
  <p>The PUT controller method is,</p>
  <pre class="lang-java prettyprint-override"><code>// ReservationApiController.java
  
  @RestController
  @RequestMapping(UriInfo.API_RESERVATION)
  @Validated
  public class ReservationApiController {
  
      @PutMapping(UriInfo.API_RESERVATION_CANCEL)
      public ReservationResponse removeReservations(
              @PathVariable @Positive int reservationInfoId) {
          
          if (!reservationInfoService.isReservationInfo(reservationInfoId)) {
              throw new ResourceNotFoundException(&quot;No reservationInfo with the id is found.&quot;);
          }
          
          return reservationInfoService.cancel(reservationInfoId);
      }
  ...
  </code></pre>
  <p>and there is the current code. What I want to do is 400 Bad response,</p>
  <pre class="lang-java prettyprint-override"><code>// GlobalExceptionHandler.java
  
  @ControllerAdvice
  public class GlobalExceptionController {
  
      @ResponseStatus(HttpStatus.BAD_REQUEST)
      @ExceptionHandler({ ConstraintViolationException.class, ... })
      public ModelAndView handleDisplayInfoNotFound(Exception e) {
          logger.error(&quot;data is not valid.&quot;, e);
  
          ModelAndView mav = new ModelAndView();
          mav.setViewName(&quot;error&quot;);
          mav.addObject(&quot;msg&quot;, &quot;유효하지 않은 요청입니다.&quot;);
  
          return mav;
      }
  </code></pre>
  <p>Putting a negative value in the path variable results in the following exception, the exception is what I expected.</p>
  <pre><code>2020-08-11 14:42:24.699 [http-nio-8080-exec-3] ERROR org.edwith.reservation.controller.page.GlobalExceptionController.handleDisplayInfoNotFound(28) - data is not valid.
  javax.validation.ConstraintViolationException: removeReservations.reservationInfoId: 0보다 커야 합니다
      at org.springframework.validation.beanvalidation.MethodValidationInterceptor.invoke(MethodValidationInterceptor.java:109) ~[spring-context-5.0.2.RELEASE.jar:5.0.2.RELEASE]
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185) ~[spring-aop-5.0.2.RELEASE.jar:5.0.2.RELEASE]
      at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:689) ~[spring-aop-5.0.2.RELEASE.jar:5.0.2.RELEASE]
      at org.edwith.reservation.controller.api.ReservationApiController$$EnhancerBySpringCGLIB$$84c5b6e0.removeReservations(&lt;generated&gt;) ~[classes/:?]
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_251]
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_251]
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_251]
      at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_251]
      at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:209) ~[spring-web-5.0.2.RELEASE.jar:5.0.2.RELEASE]
      at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:136) ~[spring-web-5.0.2.RELEASE.jar:5.0.2.RELEASE]
      at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:102) ~[spring-webmvc-5.0.2.RELEASE.jar:5.0.2.RELEASE]
      at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:871) ~[spring-webmvc-5.0.2.RELEASE.jar:5.0.2.RELEASE]
      at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:777) ~[spring-webmvc-5.0.2.RELEASE.jar:5.0.2.RELEASE]
      at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) ~[spring-webmvc-5.0.2.RELEASE.jar:5.0.2.RELEASE]
      at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:991) [spring-webmvc-5.0.2.RELEASE.jar:5.0.2.RELEASE]
      at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:925) [spring-webmvc-5.0.2.RELEASE.jar:5.0.2.RELEASE]
      at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:978) [spring-webmvc-5.0.2.RELEASE.jar:5.0.2.RELEASE]
      at org.springframework.web.servlet.FrameworkServlet.doPut(FrameworkServlet.java:892) [spring-webmvc-5.0.2.RELEASE.jar:5.0.2.RELEASE]
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:663) [servlet-api.jar:?]
      at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:855) [spring-webmvc-5.0.2.RELEASE.jar:5.0.2.RELEASE]
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:741) [servlet-api.jar:?]
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) [catalina.jar:9.0.33]
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [catalina.jar:9.0.33]
      at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200) [spring-web-5.0.2.RELEASE.jar:5.0.2.RELEASE]
      at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-5.0.2.RELEASE.jar:5.0.2.RELEASE]
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [catalina.jar:9.0.33]
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [catalina.jar:9.0.33]
      at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) [tomcat-websocket.jar:9.0.33]
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [catalina.jar:9.0.33]
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [catalina.jar:9.0.33]
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202) [catalina.jar:9.0.33]
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) [catalina.jar:9.0.33]
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541) [catalina.jar:9.0.33]
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) [catalina.jar:9.0.33]
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) [catalina.jar:9.0.33]
      at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:688) [catalina.jar:9.0.33]
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) [catalina.jar:9.0.33]
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) [catalina.jar:9.0.33]
      at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:373) [tomcat-coyote.jar:9.0.33]
      at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) [tomcat-coyote.jar:9.0.33]
      at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868) [tomcat-coyote.jar:9.0.33]
      at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1594) [tomcat-coyote.jar:9.0.33]
      at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-coyote.jar:9.0.33]
      at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:1.8.0_251]
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.8.0_251]
      at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-util.jar:9.0.33]
      at java.lang.Thread.run(Unknown Source) [?:1.8.0_251]
  </code></pre>
  <h3>Problem</h3>
  <p>Unlike what I wanted, Response code is <strong>405 with default tomcat error page</strong>. and there is an error msg like that: PUT method doesn't support JSP... (I can't attach it here because it is in korean language)</p>
  <ol>
  <li>How can I implement the exception handling I want?</li>
  <li>Is it good to return a HTML format response from the Rest Controller? Or what form of answer would be good to return?</li>
  </ol>
  <p>Thank you for reading!</p>