문서의 선택한 두 판 사이의 차이를 보여줍니다.
양쪽 이전 판 이전 판 다음 판 | 이전 판 | ||
springframework:springboot [2018/11/28 13:04] kwon37xi [SpringBoot] |
springframework:springboot [2022/10/26 10:14] kwon37xi |
||
---|---|---|---|
줄 11: | 줄 11: | ||
* [[springframework: | * [[springframework: | ||
* [[springframework: | * [[springframework: | ||
+ | * [[springframework: | ||
+ | * [[springframework: | ||
+ | * [[springframework: | ||
+ | * [[https:// | ||
===== @EnableAutoConfiguration ===== | ===== @EnableAutoConfiguration ===== | ||
줄 40: | 줄 44: | ||
* [[https:// | * [[https:// | ||
* SpringBoot 로딩중 이벤트를 받아 처리한다. | * SpringBoot 로딩중 이벤트를 받아 처리한다. | ||
+ | |||
+ | ===== SpringBoot WebMVC 정적 리소스(static resource) ===== | ||
+ | ==== static resource 서빙 경로 ==== | ||
+ | * '' | ||
+ | * jar 애플리케이션을 실행한 디렉토리 하위의 '' | ||
+ | * '' | ||
+ | @Configuration | ||
+ | public class StaticResourceConfig extends WebMvcConfigurerAdapter { | ||
+ | @Override | ||
+ | public void addResourceHandlers(ResourceHandlerRegistry registry) { | ||
+ | registry.addResourceHandler("/ | ||
+ | .addResourceLocations(" | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | ==== static resource 관련 프라퍼티 ==== | ||
+ | * [[https:// | ||
+ | < | ||
+ | spring.mvc.static-path-pattern=/ | ||
+ | |||
+ | server.compression.enabled=true | ||
+ | spring.resources.chain.cache=true | ||
+ | server.compression.min-response-size=2048 | ||
+ | spring.resources.chain.enabled=true | ||
+ | spring.resources.cache-period=3600 | ||
+ | </ | ||
+ | |||
===== 참고 ===== | ===== 참고 ===== | ||
줄 50: | 줄 82: | ||
* [[http:// | * [[http:// | ||
* [[https:// | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// |