thymeleaf There was an unexpected error (type=Internal Server Error, status=500).

使用thymeleaf依赖,无法访问html文件,解决方法有以下几种可能:

1. 未加载thymeleaf依赖,打开pom.xml,加入依赖:

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

2. html文件有问题,无法解析


3. 以上都不是
那可能是各种问题,数据库、页面跳转设置问题,这种情况是后端出现故障
这个时候,打开console,一定能找到ERROR输出,查找原因,比如我这里问题是:
thymeleaf  There was an unexpected error (type=Internal Server Error, status=500)._html


这是由于:
thymeleaf  There was an unexpected error (type=Internal Server Error, status=500)._java_02


也就是thymeleaf+layui加载页面渲染时出现问题,这个时候需要找到对应的解决方法解决即可。