前言
使用SpringBoot来开发项目相对于传统模式,要快速优雅许多,相信目前国内绝大部分web项目的开发还没有使用SpringBoot来做,如果你正需要开发一个web项目,不妨尝试使用SpringBoot来做。
本身SpringBoot是内嵌了web服务器,不需要单独的Tomcat,但是实际生产环境中,如果是web项目,Tomcat肯定是运维部门部署好了的,这个Tomcat,做了一些个性化的设置,开发出来的项目需要部署到这个Tomcat,如果是使用SpringBoot开发web服务,我认为可以直接使用内嵌的Tomcat,简单易于维护。
技术框架
要点
开发过程
1.创建一个Maven Project(quickstart),名称为myweb,添加POM依赖
4.0.0 com.boyue myweb war 0.0.1-SNAPSHOT myweb Maven Webapp http://maven.apache.org org.springframework.boot spring-boot-starter-parent 1.4.2.RELEASE org.springframework.boot spring-boot-starter-web org.springframework.boot spring-boot-starter-thymeleaf org.springframework.boot spring-boot-starter-tomcat provided org.apache.maven.plugins maven-war-plugin myweb