3 写一个入口类4 写个home.html5 在工程的resources目录下创建一个application.properties文件,这个文件是spring-boot用来配置一些工程属性用的org.springframework.boot spring-boot-starter-parent1.5.4.RELEASE org.springframework.boot spring-boot-starter-thymeleaf
# 配置服务器端口,默认是8080,可以不用配置server.port=8080# 模板配置# 这个开发配置为false,避免改了模板还要重启服务器spring.thymeleaf.cache=false# 这个是配置模板路径的,默认就是templates,可不用配置spring.thymeleaf.prefix=classpath:/templates/# 这个可以不配置,检查模板位置spring.thymeleaf.check-template-location=true# 下面3个不做解释了,可以不配置spring.thymeleaf.suffix=.html spring.thymeleaf.encoding=UTF-8 spring.thymeleaf.content-type=text/html# 模板的模式spring.thymeleaf.mode=HTML5
作者:芥末无疆sss
链接:https://www.jianshu.com/p/a34f7d330d5d
來源:简书
简书著作权归作者所有,任何形式的转载都请联系作者获得授权并注明出处。



