문서의 선택한 두 판 사이의 차이를 보여줍니다.
양쪽 이전 판 이전 판 다음 판 | 이전 판 다음 판 양쪽 다음 판 | ||
springframework:springboot [2018/08/28 09:24] kwon37xi |
springframework:springboot [2019/04/05 15:33] kwon37xi [SpringBoot WebMVC 정적 리소스(static resource)] |
||
---|---|---|---|
줄 9: | 줄 9: | ||
* [[springframework: | * [[springframework: | ||
* [[springframework: | * [[springframework: | ||
+ | * [[springframework: | ||
+ | * [[springframework: | ||
+ | * [[springframework: | ||
+ | * [[springframework: | ||
- | ===== Dependency Version Override | + | ===== @EnableAutoConfiguration |
- | 의존 라이브러리의 버전을 다른 것으로 바꾸고자 한다면 property를 변경하면 된다. | + | * [[https:// |
- | < | + | * 특정 Auto Configuration 방지< |
- | // 하이버네이트 버전 | + | @EnableAutoConfiguration(exclude = { |
- | ext[' | + | |
+ | DataSourceTransactionManagerAutoConfiguration.class, | ||
+ | HibernateJpaAutoConfiguration.class}) | ||
</ | </ | ||
- | + | | |
- | | + | |
===== JRebel SpringBoot / Gradle ===== | ===== JRebel SpringBoot / Gradle ===== | ||
* [[https:// | * [[https:// | ||
- | |||
- | |||
===== DataSource ===== | ===== DataSource ===== | ||
줄 36: | 줄 39: | ||
* 위 예에서 설정값은 '' | * 위 예에서 설정값은 '' | ||
- | ===== BootRun | + | ==== SpringApplicationRunListener |
- | ==== Debug Mode ==== | + | * [[https:// |
- | < | + | * SpringBoot 로딩중 이벤트를 받아 처리한다. |
- | bootRun | + | |
- | | + | ===== SpringBoot WebMVC 정적 리소스(static resource) |
+ | * ''/ | ||
+ | * jar 애플리케이션을 실행한 디렉토리 하위의 '' | ||
+ | * '' | ||
+ | @Configuration | ||
+ | public class StaticResourceConfig extends WebMvcConfigurerAdapter | ||
+ | | ||
+ | public void addResourceHandlers(ResourceHandlerRegistry registry) { | ||
+ | registry.addResourceHandler("/ | ||
+ | .addResourceLocations(" | ||
+ | } | ||
} | } | ||
</ | </ | ||
+ | ==== static resource 관련 프라퍼티 ==== | ||
+ | < | ||
+ | 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 | ||
+ | </ | ||
===== 참고 ===== | ===== 참고 ===== | ||
* [[http:// | * [[http:// |