API 란? Application Programming Interface의 약자. Appllication Programming 은 응용 프로그래밍을 뜻하고, 인터페이스는 서로 다른 두 개의 시스템이 정보를 주고 받도록 이어주는 경계를 뜻한다. 즉, API는 운영체제와 응용프로그램 사이의 통신에 사용되는 언어나 메시지 형식을 말한다. 이전의 서버는 백엔드에서 데이터를 이용해서 완성된 HTML를 브라우저에게 전달해줘서, 브라우저는 단순한 뷰어 역할로 쓰였다. 요즘의 서버는 브라우저에서 필요한 데이터만을 전달하는 API 서버의 형태로 변화하고 있다. 즉, 서버는 브라우저에게 완성된 HTML이 아닌, 브라우저에서 요구하는 순수한 데이터를 전해준다. 이전 방법에서는, 모델에 있는 key 값에 대응하는 value를..
MVC란? Model, View, Controller 의 약자. 어플케이션을 3가지의 역할로 구분한 '개발 방법론' 이다. 이 역할들이 서로 상호작용한 결과물이 사용자에게 보여지게 되는 것이다. 사용자가 Controller를 조작하면 Controller가 Model을 호출하고 Model이 데이터를 이용하여 만들어낸 결과를 Controller 에게 리턴해서 Contorller는 그 결과를 View에 반영하고 View는 사용자에게 보여진다. HelloController 변경 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 package hello.hellospring.controller; import org.springframework.ster..
docs.spring.io/spring-boot/docs/2.3.1.RELEASE/reference/html/spring-boot-features.html#boot-features-spring-mvc-static-content Spring Boot Features Graceful shutdown is supported with all four embedded web servers (Jetty, Reactor Netty, Tomcat, and Undertow) and with both reactive and Servlet-based web applications. It occurs as part of closing the application context and is performed in the ear..
dirgradlew.bat이있음을볼수있다. gradlew.bat gradlewcleanbuild−−info cd libs $ dir hello-spring-0.0.1-SNAPSHOT.jar 이 생성되어 있음을 알 수 있다. cd java -jar hello-spring-0.0.1-SNAPSHOT.jar 빌드 됐고, 서버도 정상적으로 잘 작동됨을 알 수 있다!
build.gradle 에 해당 라인(볼드체)을 추가한다. 1 2 3 4 5 6 dependencies { implementation 'org.springframework.boot:spring-boot-starter-thymeleaf' implementation 'org.springframework.boot:spring-boot-starter-web' implementation 'org.springframework.boot:spring-boot-devtools' testImplementation 'org.springframework.boot:spring-boot-starter-test' } Colored by Color Scripter cs 원래는 파일을 수정한 후에 서버를 재시작해야 변경사항이 적용됐었..
spring initializer 이용하여 spring 프로젝트 생성한다. 아래의 링크를 클릭하여 이동하고, 이미지와 동일하게 설정한 후 Generate 를 클릭해준다. start.spring.io/ 다운을 받은 후, 압축을 해제해준다. IntelliJ에서 build.gradle 을 Project로 열어준다. src > main > java > hello.hellospring > HelloSpringApplication 해당 위치에 아래와 같은 파일이 생성되었음을 확인할 수 있다. 1 2 3 4 5 6 7 8 9 10 11 12 13 package hello.hellospring; import org.springframework.boot.SpringApplication; import org.springf..