톰캣 설정 추가

master
mjkhan21 1 year ago
parent 2032e16d36
commit f0d5a06eb4

@ -4,7 +4,11 @@ import java.util.Map;
import javax.annotation.Resource; import javax.annotation.Resource;
import org.apache.catalina.Context;
import org.apache.catalina.servlets.DefaultServlet; import org.apache.catalina.servlets.DefaultServlet;
import org.apache.catalina.webresources.ExtractingRoot;
import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
import org.springframework.boot.web.server.WebServerFactoryCustomizer;
import org.springframework.boot.web.servlet.FilterRegistrationBean; import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.boot.web.servlet.ServletRegistrationBean; import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
@ -67,4 +71,15 @@ public class ServletConfig {
return bean; return bean;
} }
@Bean
public WebServerFactoryCustomizer<TomcatServletWebServerFactory> servletContainerCustomizer() {
return (TomcatServletWebServerFactory container) -> {
container.addContextCustomizers((Context context) -> {
context.setResources(new ExtractingRoot());
context.setReloadable(false);
});
};
}
} }
Loading…
Cancel
Save