spring-boot–使用thymeleaf模板
参考:http://blog.csdn.net/u014695188/article/details/52347318 参考:http://blog.csdn.net/u012706811/article/details/52185345 整体步骤: (1) 在pom.xml中引入thymeleaf; (2) 如何关闭thymeleaf缓存 (3) 编写模板文件.html Spring Boot默认就是使用thymeleaf模板引擎的,所以只需要在pom.xml加入依赖即可: «/span>dependency> «/span>groupId>org.springframework.boot</groupId> «/span>artifactId>spring-boot-starter-thymeleaf</artifactId> </dependency> Thymeleaf缓存在开发过程中,肯定是不行的,那么就要在开发的时候把缓存关闭,只需要在application.properties进行配置即可: [html] view plain copy ######################################################## ###THYMELEAF (ThymeleafAutoConfiguration) ######################################################## #spring.thymeleaf.prefix=classpath:/templates/ #spring.thymeleaf.suffix=.html #spring.thymeleaf.mode=HTML5 #spring.thymeleaf.encoding=UTF-8 # ;charset= is added #spring.thymeleaf.content-type=text/html # set to false for hot refresh spring.thymeleaf.cache=false 编写模板文件src/main/resouces/templates/helloHtml.html [html] view plain copy 编写访问路径(com.kfit.test.web.TemplateController): [html] view plain copy package com.kfit.test.web; import java.util.Map; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; /** 模板测试. @author Administrator */ @Controller publicclass TemplateController { /** ...