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

resouces/static/hello-static.html 로 이 코드를 작성한 후

http://localhost:8080/hello-static.html 직접 접근을 하였다.

이렇게 나오는 것을 확인할 수 있었다.

 

원리는 간단하게

웹 브라우저에서 http://localhost:8080/hello-static.html 이렇게 요청을 보내면 

내장 톰캣 서버에서 요청을 받고 스프링에게 넘긴다.

스프링은 컨트롤러에서 우선 hello-spring이 있는지 찾는다.

없다면 resouces/static/에서 찾아서 응답을 보낸다!

 

 

 

'웹프로그래밍 > Spring 입문' 카테고리의 다른 글

6. 회원 도메인과 리포지토리 만들기  (0) 2021.06.17
5. 비즈니스 요구사항 정리  (0) 2021.06.17
4. API  (0) 2021.06.17
3. MVC와 템플릿 엔진  (0) 2021.06.16
1. View 환경설정  (0) 2021.06.15

+ Recent posts