springboot报错Circular view path [index]: would dispatch back to the current handler URL [

springboot报错,Circular view path [index]: would dispatch back to the current handler URL […

经检查,跳转代码没有问题,甚至逻辑都没写,但始终报错,多方查找,finally,我发现了这个:

注:版本改一改,原因是springboot默认支持2.x版本,因此需要手动修改

<properties>
        <java.version>11</java.version>
        <thymeleaf.version>3.0.11.RELEASE</thymeleaf.version>
        <thymeleaf-layout-dialect.version>2.1.1</thymeleaf-layout-dialect.version>
    </properties>

在application.properties中可以自己配置参数

spring.thymeleaf.prefix=classpath:/templates/  设置thymeleaf路径默认为src/main/resources/templates
spring.thymeleaf.suffix=.html  设置thymeleaf模板后缀
spring.thymeleaf.content-type=text/html
spring.thymeleaf.cache=false  是否开启缓存默认为true
spring.thymeleaf.mode=LEGACYHTML5  设置thymeleaf严格校验
spring.thymeleaf.encoding=UTF-8    设置编码

顺便记录一下,
@RestController:返回的就是return后的内容,和@Controller不一样哦

另外,如果需要查询对应的版本,在pom.xml中,按住ctrl点击

<artifactId>spring-boot-starter-parent</artifactId>
<artifactId>spring-boot-dependencies</artifactId>

查看对应的thymeleaf版本

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值