

1) File - Open을 눌러 IdeaProjects 폴더를 연다.

2) 다운받은 spring 의존성 폴더의 압축을 풀어 IdeaProjects 폴더에 넣는다.

3) 해당 폴더를 선택하고 open 누른다.
자바 17버전이 없으면 인텔리제이에서 다운받으면 된다.
1) File - Project Structure

2) (왼쪽 탭) SDKs 에서 Download JDK

3) version : 17, vender : temurin 선택 후 다운로드


1) DemoApplication을 실행해 보거나 / build.gradle을 실행시켜 본다.

서버가 실행되면 성공이다.
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/

package com.example.demo.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
@Controller
public class DemoController {
@GetMapping("/") // routing : default 8080
public String hello() {
return "hello"; // hello html 반환 (resources\templets 하위 탐색)
}
}
1) resources - templates 하위에 hello.html 파일을 만든다.
html 양식 생성 : ! ,Tab 입력

<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<div>hello</div>
<script>
alert("hello");
</script>
</body>
</html>
localhost:8080
8080 포트의 hello.html파일을 읽어온 모습이다.
