创建Spring Boot应用

在基于Spring来重构JSP应用之前,我们先引入Spring Boot,使之成为一个Spring Boot应用。你只需要在原来的代码基础上,增加简单的配置和少量的代码即可引入Spring Boot,整个过程5分钟就能完成。
这里我们使用Maven来管理依赖,因为我们需要增加Spring Boot相关的依赖。也可以在Eclipse或者IntelliJ中创建一个新的Maven项目。
在POM文件中加入Spring Boot相关的配置。
<parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>1.3.2.RELEASE</version> </parent> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-tomcat</artifactId> <scope>provided</scope> </dependency> <dependency> <groupId>org.apache.tomcat.embed</groupId> <artifactId>tomcat-embed-jasper</artifactId> <scope>provided</scope> </dependency> <dependency> <groupId>javax.servlet</groupId> <artifactId>jstl</artifactId> <scope>provided</scope> </dependency> </dependencies>