thymeleaf 템플릿 엔진

장점

단점

thymeleaf 템플릿 엔진 동작

자세한 설명 참고

HelloController 클래스를 만듭니다.

Untitled

package jpabook.jpashop;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

@Controller
public class HelloController {

    @GetMapping("hello")
    public String hello(Model model) {
        model.addAttribute("data", "hello!!");
        return "hello";
    }
}