springBoot jsp

@Configuration
public class SpringBootJSPConfiguration {

@Bean
public WebServerFactoryCustomizer<TomcatServletWebServerFactory> customizer() {
return (factory) -> {
factory.addContextCustomizers((context) -> {
//当然这里要写你自己的
String relativePath = "erp/src/main/webapp";
File docBaseFile = new File(relativePath);
// 路径是否存在
if (docBaseFile.exists()) {
context.setDocBase(docBaseFile.getAbsolutePath());
}
}
);
};
}

}
posted @ 2019-09-25 11:30  ±小马哥  阅读(195)  评论(0编辑  收藏  举报