05-18 00:26
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
Tags
- 셀레니움
- Operator
- Class
- Inheritance
- dbms
- literal
- Polymolphism
- Entity
- Binary Search
- preprocessing
- descriptive statistics
- 리눅스
- Java
- BFS
- External Scheme
- Unity
- 자바
- X윈도우
- selenium
- Physical Scheme
- X.org
- 리눅스 마스터 1급
- Reference Type
- OOP
- spring
- Mac
- python
- 백준
- Entity Set
- systemd
Archives
- Today
- Total
Byeol Lo
Spring - static 폴더 본문
Spring은 기본 설정으로 정적컨텐츠를 static폴더에서 찾아서 제공한다. 변하지 않는 html 파일을 넣은 다음 url Path에 Application을 실행시켜주면 된다.
//src/main/resources/static/hello.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>hello</title>
</head>
<body>
<p>hihi</p>
</body>
</html>
해당 파일을 넣고 실행시킨 후에 localhost:8080/hello.html로 들어가면 해당 파일을 그대로 제공해준다.
웹 클라이언트 > 내장 톰캣 서버 > 스프링 컨테이너(hello 관련 컨트롤러를 찾음) > 없으면 resources의 static/hello.html을 찾음 그런 후에 반환을 함.
'BackEnd > Spring' 카테고리의 다른 글
Spring IOC(Inversion of Control), DI(Dependency Injection) (0) | 2022.08.30 |
---|---|
Spring - MVC와 템플릿 엔진 (0) | 2022.08.28 |
build.gradlew (0) | 2022.08.24 |
Spring 시작하기 (0) | 2022.08.21 |
Comments