在springboot中无法直接使用jsp,因此使用模板引擎https://docs.spring.io/spring-boot/docs/
3、模板引擎
JSP、Velocity、Freemarker、Thymeleaf
[外链图片转存失败(img-onZPQVsD-1562483431131)(images/template-engine.png)]
SpringBoot推荐的Thymeleaf;
语法更简单,功能更强大;
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
2.1.6
</dependency>
切换thymeleaf版本
<properties>
<thymeleaf.version>3.0.9.RELEASE</thymeleaf.version>
<!-- 布局功能的支持程序 thymeleaf3主程序 layout2以上版本 -->
<!-- thymeleaf2 layout1-->
<thymeleaf-layout-dialect.version>2.2.2</thymeleaf-layout-dialect.version>
</properties>