<!-- [main] - [resources] - [static] - [index.html] -->
<!DOCTYPE HTML>
<html>
<head>
<title>Hello</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
Hello
<a href="/hello">hello</a>
</body>
</html>

//[main] - [java] - [hello] - [hellospring] - [controller] - [HelloController]
package hello.hellospring.controller;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
@Controller
public class HelloController {
//웹 어플리케이션에서 주소창 뒤에 '/hello'를 치면 이 메서드를 호출
@GetMapping("hello")
public String hello(Model model) {
model.addAttribute("data", "hello!");
//resources의 tmplates 'hello.html'과 이름이 같음 => 이 파일을 찾도록 return
return "hello";
}
}
<!-- [main] - [resources] - [templates] - [hello.html] -->
<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<title>Hello</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
<p th:text="'안녕하세요. ' + ${data}" >안녕하세요. 손님</p>
</body>
</html>


cd project_locationgradlew.bat 명령어 입력
cd build/libs 경로 입력 후 dir 명령어 실행
java -jar project_name-SNAPSHOT.jar 명령어 실행
gradlew.bat clean 입력