작성
·
2.1K
1
========================================
[질문 템플릿]
1. 강의 내용과 관련된 질문인가요? (예/아니오)
2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예/아니오)
3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예/아니오)
[질문 내용]
여기에 질문 내용을 남겨주세요.
다른 해결책들이 존재하긴 하는데 인테리제이 밖의 환경에서는 잘 실행이 되지 않는 문제가 있었습니다.
해당 basic.html 과 index.html 은 어차피 static 리소스인데 resources /static 안에다 넣어도 상관이 없지 않나 싶어서 여쭤봅니다 ( 정상작동합니다 )
main/webapp 안에 넣으면 동작을 잘 하지 않습니다
답변 1
1
Be wary because Spring Boot 2.4.x
disables the default servlet (which impacts on loading of src\main\webapp
and anything else at the root of your WAR file. JAR file packaging is disabled by default but there is a configuration option to all that too - see Spring boot: configure it to find the webapp folder.
https://github.com/spring-projects/spring-boot/issues/22915
The full release notes are here: https://spring.io/blog/2020/11/12/spring-boot-2-4-0-available-now
2.4 이후로는 src/main/webapp 에 뭔가 막히나 봅니다 -> 리소스로 가라네요. IDE 쪽에서 해결해 주는 것 같지만..
You can also customize the static resource locations by using the spring.web.resources.static-locations
property (replacing the default values with a list of directory locations). The root servlet context path, "/"
, is automatically added as a location as well.
이거 추가해야 하긴 하나 보네요.
스프링 부트 셋업을 했는데 안되더라고요. resource/template 파일 안에 넣어야 되더라고요..? 왜 vscode 환경에서는 안되는지 모르겠네요.