标签:div alt protect ati ref port prot config blog
1、pom.xml
与springboot-jar-web的区别是:
将
<packaging>jar</packaging>
替换成:
<packaging>war</packaging>
2、DemoApplication
import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class DemoApplication { public static void main(String[] args) { SpringApplication.run(DemoApplication.class, args); } }
3、ServletInitializer
import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; public class ServletInitializer extends SpringBootServletInitializer { @Override protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { return application.sources(DemoApplication.class); } }
4、resources下,新建目录
static templates
application.yml、application-dev.yml、DemoApplicationTests.java 与spring-jar相同。
标签:div alt protect ati ref port prot config blog
原文地址:https://www.cnblogs.com/yaoyuan2/p/11629023.html