정적페이지는 앞서 만든 Welcome과 같은 서버에 올려둔 html을 그대로 웹브라우저에 보내는 방식이다.

 

정적페이지 설명

 

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

이전에 static폴더에 index.html이 있지만, 상관하지 않고 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을 한번 입력해 보겠습니다

index.html

기존에 입력한 index.html이 로드된다. 우리가 방금 작성한 hello-static.html을 띄우기 위해서는

localhost:8080/hello-static.html 를 주소창에 입력해야합니다.

 

+ Recent posts