본문 바로가기
boostcource/boostcourse_web programming

Spring MVC 구성요소

by sgyeong 2024. 7. 7.

Spring MVC 기본 동작 흐름

 

Spring MVC는 Model 2 Architecture로 구성되어 있다.

클라이언트가 요청을 보내면 보낸 모든 요청을 Dispatcher Servlet이라고 하는 Servlet class가 받는다.  

Dispatcher Servlet은 요청을 처리해줄 Controller와 메서드가 무엇인지 Handler Mapping 물어본다.

spring MVC로 개발하게 되면 어떤 요청에 어떤 controller로 동작할지를 XML파일이나 Java 파일의 어노테이션으로 설정하게 된다. 이런 정보들을  spring으로 만들어진 웹 애플리케이션이 실행할때 Handler Mapping 객체들이 생성이 되면서 관리를 하게 된다. 

Dispatcher Servlet은  Handler Mapping으로부터 요청에 알맞는 Controller가 무엇인지 해당되는 메서드는 무엇인지에 대한 정보를 알아내게 된다. 정보를 알아내면 Handler Adapter에게 실행을 요청한다. 그 때 결정된 Controller와 해당 메서드가 실행이 되게 되고, 그 결과를 Model에 받아서 Dispatcher Servlet에 전달을 하게 된다. 이때 Dispatcher Servlet 은 Controller가 리턴한 View name을 알아오게 된다. View name으로 적절한 View Resolver를 통해서 view를 출력하게 된다. View 의 정보를 알려주게 되면 view로 전달을 하게 된다.

 

 

요청 처리를 위해 사용되는 컴포넌트

 

- DispatcherServlet

HandlerMapping

HandlerAdapter

MultipartResolver

LocaleResolver

ThemeResolver

HandlerExceptionResolver

RequestToViewNameTranslator

ViewResolver

FlashMapManager

 

 

 

 

 

 

 

참고  :   boostcourse    https://www.boostcourse.org/web316/lecture/254346/?isDesc=false

 

웹 프로그래밍(풀스택)

부스트코스 무료 강의

www.boostcourse.org

 

https://terasolunaorg.github.io/guideline/1.0.1.RELEASE/en/Overview/SpringMVCOverview.html

 

2.2. Overview of Spring MVC Architecture — TERASOLUNA Global Framework Development Guideline 1.0.1.RELEASE documentation

2.2. Overview of Spring MVC Architecture Official website of Spring MVC says the following Spring Reference Document. Spring’s web MVC framework is, like many other web MVC frameworks, request-driven, designed around a central Servlet that dispatches req

terasolunaorg.github.io

https://jess-m.tistory.com/15

 

Spring MVC - DispatcherServlet 동작 원리

스프링 MVC는 어떻게 작동하는가? 스프링 MVC 프레임워크는 Model-View-Controller 아키텍쳐를 제공해주고, 쉽고 유연한 개발을 하도록 지원해준다. 스프링 MVC에서 가장 큰 주체는 DispatcherServlet이다. Disp

jess-m.tistory.com

https://www.baeldung.com/spring-xml-vs-java-config

https://samerabdelkafi.wordpress.com/2014/08/03/spring-mvc-full-java-based-config/

 

Spring MVC – Full java based config

Spring MCV is a very powerful and flexible framework for web application development. It doesn’t just implement the MVC pattern, it allows you to develop Rest web services.    …

samerabdelkafi.wordpress.com

 

 

https://github.com/arey/spring-javaconfig-sample/blob/master/src/main/webapp/WEB-INF/web.xml

 

spring-javaconfig-sample/src/main/webapp/WEB-INF/web.xml at master · arey/spring-javaconfig-sample

Spring JavaConfig example for Spring MVC / Spring Data JPA / Hibernate - arey/spring-javaconfig-sample

github.com

https://docs.spring.io/spring-framework/docs/3.0.6.RELEASE_to_3.1.0.BUILD-SNAPSHOT/3.1.0.BUILD-SNAPSHOT/org/springframework/web/servlet/config/annotation/WebMvcConfigurationSupport.html

 

WebMvcConfigurationSupport

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

docs.spring.io

 

https://www.baeldung.com/spring-requestmapping

 

'boostcource > boostcourse_web programming' 카테고리의 다른 글

Spring MVC 웹 어플리케이션 실습  (0) 2024.07.07
Spring MVC 구성 요소 2  (0) 2024.07.07
Spring MVC  (0) 2024.07.07
Select, Delete  (0) 2024.07.06
Insert, Update  (0) 2024.07.02