김영한님의 인프런 무료 강의
1) 스프링의 라이브러리 > 만일 A라는 라이브러리를 사용한다면, A 라이브러리가 필요한 a, b, c, 라이브러리를 모두 끌어온다.
2) welcome Page, Thymeleaf 템플릿 엔진, Model)
3) 빌드하고 실행하기(윈도우에서!
src
-main
-static
경로에 index.html
을 올려두면 Welcome Page의 기능을 제공한다.
Controller(Hello)에서 리턴값인 "hello"(문자열)는 ViewResolver가 찾을 화면의 이름이다(hello.html)
ViewResolver는 resources폴더의
template
의hello.html(문자열.html)
을 찾는다.
model.addAttribute(key값, value값)
hello.html
의${data}
(name값)에"hello!!!"
(value)값이 들어가게 된다.
1) window버튼 + R, cmd 입력 후 엔터
현재 c드라이브의 사용자폴더(Users)의 jhyeo라는 폴더안에 들어와있는 상태이다.
내 프로젝트는 jhyeo -> IdeaProjects -> hello-spring -> hello-spring안에 파일들이 들어있다.현재 cmd 상태 :
C:\Users\jhyeo>
2) jhyeo폴더에서 IdeaProjects, hello-spring, hello-spring 총 3단계를 넘어가야한다.
C:/Users/jhyeo
에서
cd IdeaProjects/hello-spring/hello-spring 엔터
3) 현재 위치
이렇게 된다.
4) 이어서 gradlew.bat build 입력 후 엔터
뭐라뭐라ㅣ 뜨면서BUILD SUCCESSFUL
출력
5) build폴더 생성됨.(근데 나는 하기전에도 있었다..?)
6) build -> libs 폴더에 2개의 jar파일 있으면 완료
7) build/libs폴더로 이동
8) java -jar hello-spring-0.0.1-SNAPSHOT.jar 엔터
※ 인텔리제이에서 서버끄고하기
웹사이트에 localhost:8080 등 확인해보면 치면 작동하는것을 확인할 수 있다.