[Spring] thymeleaf 템플릿 엔진 사용 예시 (feat. @Controller, @Getmapping, Model, viewResolver)
이전에 static폴더에서 welcome page를 작성해봤다. 이번엔 templates 폴더에서 thymeleaf를 이용해서 view처리를 해보자. (아직 개념이 부족해서 설명이 적절하지 않거나, 부정확 할 수 있다.) http://localhost:8080/hello 경로 진입시 페이지 처리 과정 1. http://localhost:8080 경로 진입시 welcome page 노출 2. http://localhost:8080/hello 경로 진입시 /hello 가 처리된 결과물이 노출되어야함. 3. @Controller 어노테이션을 가진 클래스를 찾는다. >>> ㅁ (빨간 박스) 4. 해당 클래스 안에서 @Getmapping 어노테이션에서 요청이 "hello"인 메서드를 찾는다. >>> ㅁ (빨간 박..
개발 공부/Spring
2024. 2. 26. 19:42