springboot 启动 thymeleaf报错

springboot 导入thymeleaf后启动报错

报错如下(一部分)

The following method did not exist:      org.thymeleaf.spring5.SpringTemplateEngine.setRenderHiddenM

一开始在maven中的配置是这样的

        <dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-thymeleaf</artifactId>
		</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>

把properties标签那两个改成

<springboot-thymeleaf.version>3.0.9.RELEASE</springboot-thymeleaf.version>
<thymeleaf-layout-dialect.version>2.3.0</thymeleaf-layout-dialect.version>

就ok了!

你可能感兴趣的:(springboot 启动 thymeleaf报错)