
https://www.inflearn.com/course/스프링-mvc-1# 강의 내용 중 일부 발췌 (이미지 사용 허가 완료)
Filter를 순회시키는 역할은 ApplicationFilterChain 클래스의 doFilter()가 수행합니다.
*Invoke the next filter in this chain, passing the specified request and response. If there are no more filters in this chain, invoke the service() method of the servlet itself. 체인의 다음 필터를 호출해 지정된 요청과 응답을 전달합니다. 더 이상 필터가 없으면 서블릿 자체의 service() 메서드를 호출합니다.
스프링에서 제공하는 CharacterEncodingFilter, WebMvcMetricsFilter, FormContentFilter, RequestContextFilter 등을 순회하며 동작을 수행합니다.
스프링 시큐리티 관련 필터들을 순회하며 동작을 수행합니다.
개발자가 커스텀하게 적용한 필터들을 순회하며 동작을 수행합니다.
supports() 메서드는 발견된 핸들러가 HandlerMethod 타입인지 확인합니다. 이후 supportsInternal(..)를 호출하는데 이땐 항상 true를 반환합니다. 이유는 주석에 적혀있습니다.
*Always return true since any method argument and return value type will be processed in some way. A method argument not recognized by any HandlerMethodArgumentResolver is interpreted as a request parameter if it is a simple type, or as a model attribute otherwise. A return value not recognized by any HandlerMethodReturnValueHandler will be interpreted as a model attribute.
메서드 인수 및 반환 값 타입은 어떤 방식으로든 처리되므로 항상 true를 반환합니다. 어떤 HandlerMethodArgumentResolver에서도 인식되지 못하는 메서드 인수가 단순한 타입이면 request parameter로 해석되고 그렇지 않다면 modelAttribute 특성으로 해석됩니다. HandlerMethodReturnValueHandler에서 인식하지 못하는 반환 값은 model attribute 특성으로 해석됩니다.*