Spring Framework

Spring) 빌드하고 실행하기 / 정적 컨텐츠 / MVC와 템플릿 엔진

na_o 2022. 1. 8. 00:50
728x90

빌드하고 실행하기

./gradlew build 명령어를 콘솔에 입력하면 빌드가 되는데 

환경변수로 설정한 JDK를 사용하는 것 같다

프로젝트에서 쓰이는 Java 버전은 11인데

이전에 환경변수로 지정해 놓은 Java 버전은 8이다

그래서 빌드가 되지 않았다


스프링 웹 개발 기초

웹 개발의 종류

 

정적 컨텐츠

- Spring Boot Features

 

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 earliest

docs.spring.io

// resources/static/hello-static.html

<!DOCTYPE HTML>
<html>
<head>
 <title>static content</title>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
정적 컨텐츠 입니다.
</body>
</html>

localhost:8080/hello-static.html

 

 

정적 컨텐츠가 브라우저에 나타나기까지 과정


MVC와 템플릿 엔진

 

 

http://localhost:8080/hello-mvc?name=spring

 

 

MVC, 템플릿 엔진 이미지