@Configuration
public class GlobalConfig {
@Bean
public WebServerFactoryCustomizer<TomcatServletWebServerFactory> customizer() {
return (factory) -> {
factory.addContextCustomizers((context) -> {
//模塊中webapp相對路徑
String relativePath = "tt-web/src/main/webapp";
File docBaseFile = new File(relativePath);
// 路徑是否存在
if (docBaseFile.exists()) {
context.setDocBase(docBaseFile.getAbsolutePath());
}
}
);
};
}
}
更多精彩资讯请关注tft每日頭條,我们将持续为您更新最新资讯!