[spring boot][thymeleaf]spring boot 1.5+ 页面无法找到

来源:互联网 发布:财经论坛 知乎 编辑:程序博客网 时间:2024/05/21 05:23

当页面和程序明确无误后,还是展示出以下错误:

1.[浏览器提示]
Whitelabel Error Page

This application has no explicit mapping for /error, so you are seeing this as a fallback.

Fri Oct 20 14:11:55 CST 2017
There was an unexpected error (type=Not Found, status=404).
No message available

2.程序console中并没有任何的异常提示。

解决方案:
pom.xml中加入

    <properties>        <!--            springboot 默认使用thymeleaf的2.0,即:spring-boot-starter-thymeleaf中包含的是thymeleaf2.X            springboot1.5.2+需要使用thymeleaf3.X。手动去配置        -->        <thymeleaf.version>3.0.2.RELEASE</thymeleaf.version>        <thymeleaf-layout-dialect.version>2.0.4</thymeleaf-layout-dialect.version>    </properties>