1.基础核心依赖
<parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>1.5.1.RELEASE</version> </parent>
2.web应用依赖
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
</dependencies>
3.使用freemark依赖(不和web应用依赖共存)
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-freemarker</artifactId>
</dependency>
</dependencies>
模版 templates/model.ftl
4.spring boot 应用启动入口(注解)
@SpringBootApplication
public class StartApplication
{
public static void main(String[] args)
{
SpringApplication.run(StartApplication.class,args);
}
}