68. 使用thymeleaf报异常:Not Found, status=404
来源:互联网 发布:天猫数据采集 编辑:程序博客网 时间:2024/05/15 10:33
【从零开始学习SpirngBoot—常见异常汇总】
我们按照正常的流程编码好了 controller访问访问方法/hello,对应的是/templates/hello.html文件,但是在页面中还是抛出了错误信息:
Whitelabel Error Page
This application has no explicit mapping for /error, so you areseeing this as a fallback.
Tue Jul 26 21:01:09 CST 2016
There was anunexpected error (type=Not Found, status=404).
No messageavailable
这个错误有很多方面的原因,博主说说开发过程中博主碰到的情况:
第一种情况:是否忘记引入了thymeleaf依赖,检查pom.xml文件,是否有:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
有一次写例子就给忘了,结果就不可访问了。
第二情况:检查访问地址是否正确?
不要是访问地址是/demo/hello,结果访问使用了/hello,那么肯定是无法访问的,以及模板文件的目录和hello.html文件是否正确。
这里顺便说明,如果访问的是hello.html,但是hello.html不存在,不是抛出404的错误,而是500的错误,如下信息:
Error resolving template"/hello", template might not exist or might not be accessible by anyof the configured Template Resolvers
如果看到如上信息,那么就要检查下模板文件是否存在,以及文件名称是否编写正确了。
- 68. 使用thymeleaf报异常:Not Found, status=404
- 68. 使用thymeleaf报异常:Not Found, status=404
- springboot项目浏览器报错:There was an unexpected error (type=Not Found, status=404).
- 新版Eclipse配置Servlet始终报404 Not Found与servlet Class Not Found 异常解决方案
- 引入Bootstrap老是报错:the server responded with a status of 404 (Not Found)
- JavaEE NetBeans HTTP Status 404 - Not Found
- monkey 使用报device not found
- Myeclipse 调试Maven项目报Source not found 异常
- Spring Boot Controller 无法访问 type=Not Found, status=404
- struts2 http status 404 result 'null' not found .
- jQuery("#").autocomplete 出现Status Code:404 Not Found
- the server responded with a status of 404 (Not Found)
- 关于一些mybatis异常的原因:org.apache.ibatis.binding.BindingException: Parameter 'status' not found.
- springboot使用thymeleaf 解析异常
- SrpingMVC==>Failed to load resource: the server responded with a status of 404(Not Found)
- Sat Oct 21 17:54:29 CST 2017 There was an unexpected error (type=Not Found, status=404).
- There was an unexpected error (type=Not Found, status=404). /kind/WEB-INF/page//kindEditor.jsp
- LINUX中使用VIM替换报错:pattern not found
- Oracle 树操作(select…start with…connect by…prior)
- Android使用WebView加载网页及数据
- 67. @Transactional的类注入失败
- hibernate中1+n问题
- DM&ML_note.3-朴素贝叶斯分类器
- 68. 使用thymeleaf报异常:Not Found, status=404
- mysql修改表的语法
- POJ 1521 , Entropy , Huffman
- Ubuntu SSH登陆出现Access Denied错误
- 69. JPA实体Bean的生命周期
- 前端复习--window.name跨域完全搞定
- CSS元素隐藏、display:none和visibility:hidden、height:0和overflow:hidden的组合
- 70. 打印所有Spring boot载入的bean
- java 面向对象 接口与多态