spring 4

[spring] 스프링 웹 개발 기초

✦ 정적 컨텐츠 ✦ MVC 템플릿 엔진 ✦ API https://docs.spring.io/spring-boot/docs/2.3.1.RELEASE/reference/html/spring-boot-features.html#boot-features-spring-mvc-static-content ✔︎정적컨텐츠 html 그대로~ 웹브라우저>톰캣>컨트롤러x>resources:static/hello-static.html ✔︎ MVC 템플릿 엔진 MVC : Model, View, Controller required=false로 하면 name값이 없어도 실행됨 ✔︎ API 인텔리제이 단축키 control+enter -> getter and setter @ResponseBody 를 사용 HTTP의 BODY에 문자 내용을..

spring 2023.01.24

[spring] 프로젝트 생성

spring boot 3.0부터는 java 17 설치 인텔리제이 설치 start.spring.io 접속 -> spring initalizr generate 후 압축을 풀어 인텔리제이에서 open project -> build.gradle main메서드를 실행하면 hellospringapplication이 실행된다. 스프링부트 프로젝트를 생성할 시 내장 서블릿 컨테이너인 tomcat이 자동설정된다. 인텔리제이 - settings - Build Tools - Gradle -> Build and run using, Run tests using : intellij IDEA로 설정 (gradle로 설정하면 느림) -> Gradle은 의존관계가 있는 라이브러리를 함께 다운로드 한다. 스프링 부트 라이브러리 spri..

spring 2023.01.23