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());
}
}
);
};
}

}

猜你喜欢

转载自www.cnblogs.com/-mzh/p/11583619.html