Spring/spring_old

03./ Spring View 출력

slow333 2023. 1. 11. 13:19

브라우저 요청 -> localhost:8080/hello -> tomcat

-> spring container -> controller를 찾아서 model에서 처리해서 -> viewResolver로 보내면

-> viewResolver에서 templates 밑에있는 html 파일(model이 포함된 method의 return 값에 해당되는 이름의 html 파일)을

    찾아서(thymeleaf 템플릿 엔진에서 처리한 결과를)

-> hello.html파일을 웹 브라우저에 전달

스프링 부트 템플릿엔지 기본 viewName mapping => 'resoures:templates/' + {viewName} + '.html'

 

[기본 페이지 열기]

spring은 기본적으로 java class의 controll annotation을 검색해서 있으면 이 것을 먼저 실행

없으면 static 폴더 밑을 찾아서 index.html파일을 기본으로 전달함

 

 

'Spring > spring_old' 카테고리의 다른 글

05./ Spring excersise-Member-설계  (0) 2023.01.11
04./ spring 웹 개발  (0) 2023.01.11
02./ spring 환경 구성 검증  (0) 2023.01.11
01./ start.string.io  (0) 2023.01.11
02. Project 생성-UML  (0) 2023.01.07