zenn.skin 무료버전 배포중!
자세히보기

2024/10/04 3

Web/Spring
[Spring Web 6.1] DispatcherServlet 뜯어보기 - getter & setter

getter요소에 대한 getter@Nullablepublic final MultipartResolver getMultipartResolver() { return this.multipartResolver;}@Nullablepublic final List getHandlerMappings() { return this.handlerMappings != null ? Collections.unmodifiableList(this.handlerMappings) : null;}getter에서 mutlpartResolver, handlerMappings는 말그대로 dispatcherServlet이 갖는 속성값을 반환해준다.크게 얘기할 부분이 없다. request에 사용되는 getter@Nullableprot..

Web/Spring
[Spring Web 6.1] DispatcherServlet 뜯어보기 - Constructor & init

이번에는 init 관련 메서드를 정의해보려 한다. getter, setter와 함께 보려 했는데 init 관련 함수만 해도 생각보다 양이 많아서 나누어 정리해보려 한다. Constructorpublic DispatcherServlet() { this.setDispatchOptionsRequest(true);}public DispatcherServlet(WebApplicationContext webApplicationContext) { super(webApplicationContext); this.setDispatchOptionsRequest(true);}dispatcherServlet은 코드양에 비해 아주 간단한 생성자를 가진다.wac을 받거나 받지 않는 경우인데, wac을 매개변수로 받..

Web/Spring
[Spring Web 6.1] DispatcherServlet 뜯어보기 - Deprecated & Static

Spring을 공부하면서 라이브러리를 직접 뜯어봐도 재미있을 것 같아 시간이 날 때마다 하나씩 뜯어보려고 한다.워낙 코드가 많기 때문에 web 서버에서 빠질 수 없는 Spring web의 dispatcherServlet의 코드를 보려고 한다.DispatcherServlet 코드만 900줄 가까이 되기 때문에 이론상으로만 알고 있던 내부 로직을 코드로 직접 뜯어보고 느껴보는 것도 많은 도움이 될 것 같아.Spring Web 6.1을 기준으로 코드를 분석해보려 하고, deprecated된 코드부터 살펴보려 한다.변수에 대한 내용은 그 때, 그 때 메서드를 분석할 때마다 같이 공부해보려 한다. Deprecated1) setThrowExceptionIfNoHandlerFound/** @deprecated */@..