当前位置: 首页 > 工具软件 > Hint View > 使用案例 >

错误记录 - This may be the result of an unspecified view, due to default view name generation

白越
2023-12-01
  • 问题描述
    初学尝试使用springboot 无法跳转页面 ,报错500
  • 异常信息:

javax.servlet.ServletException: Circular view path [index]: would dispatch back to the current handler URL [/index] again. Check your ViewResolver setup! (Hint: This may be the result of an unspecified view, due to default view name generation.)

  • 问题原因
    未引入Thymeleaf模板依赖,

  • 解决方案

  • <dependency>
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-thymeleaf</artifactId>
      </dependency> 
    

`

但我在加入依赖后仍无法引入Thymeleaf包,发现libraries仍未引入包,reimport 无效,后指定thymeleaf版本成功引入

 <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputeEncoding>UTF-8</project.reporting.outputeEncoding>
        <java.version>1.8</java.version>
        <thymeleaf.version>3.0.2.RELEASE</thymeleaf.version>
        <thyeleaf-layout-dialect.version>2.1.1</thyeleaf-layout-dialect.version>
    </properties>
 类似资料: