MVC와 템플릿 엔진
<aside>
<img src="/icons/sign-in_green.svg" alt="/icons/sign-in_green.svg" width="40px" />
설명
- MVC란, Model, View, Controller의 약자
- View와 Controller를 나눠서 각자의 일에만 집중하는 구조
- View : 화면을 관련에 관련된 작업
- Controller : 비지니스 로직, 서버 뒷 단에 관련된 작업
- Model : Controller에게 화면에 필요한 것을 담아 받고, View에게 넘겨줌
</aside>
<aside>
<img src="/icons/layers_orange.svg" alt="/icons/layers_orange.svg" width="40px" />
예시

- hello-mvc?name=spring!
- hello-mvc부분에서 name=spring!으로 name의 값을 spring!으로 받아옴
</aside>
<aside>
<img src="/icons/piano_brown.svg" alt="/icons/piano_brown.svg" width="40px" />
MVC, 템플릿 구조 이미지

- localhost:8080/hello-mvc를 넘기면 내장 톰켓 서버를 거침
- helloController에 매핑이 되어있는 걸 확인 후
- return : hello-template
- model(name:spring!)
- view에 있는 “hello-template”.html에 return
- Thymeleaf 템플릿 엔진 처리 후 HTML로 변환하여 출력
</aside>