SSONG Cloud

Spring MVC 구현 본문

프로그래밍/Spring Framework

Spring MVC 구현

SSONGMI 2021. 5. 9. 23:10
반응형

1. web.xml 

: DispatcherServlet 설정

: <init-param>을 설정하지 않을 시 <servlet-name>-servlet.xml 파일에서 applicationContext 정보 로드

: 스프링 컨테이너는 설정파일의 내용을 읽고 ApplicationContext 객체 생성

: <url-patter>은 DispatcherServlet이 처리하는 URL Mapping pattern 정의

: Servlet이므로 1개 이상의 DispatcherServlet 설정 가능

: <load-on-startup>1</load-on-startup> 설정시 WAS startup시 초기화 작업진행

: 최상위 RootContextLoader 설정

 

2. Application Context 분리

: 어플리케이션 레이어에 따라 어플리케이션 컨텍스트 분리

 

3. Controller class 작성

 

4. Context 설정파일에 Controller 등록(Servlet-context.xml)

 

5. Controller와 response page를 연결하기 위해 ViewResolver 설정(Servlet-context.xml)

 

6. JSP 파일 작성

반응형

'프로그래밍 > Spring Framework' 카테고리의 다른 글

Spring Web Application 동작 순서  (0) 2021.05.09
Spring MVC 실행순서  (0) 2021.05.09
Spring MVC 구성요소  (0) 2021.05.09
Dependency Injection  (0) 2021.05.09
Spring DI 용어  (0) 2021.05.09
Comments