Error resolving template: template might not exist or might not be accessible是一句缩水报错?
一
thymeleaf在开发的时候本地调试正常,但是在测试环境打成jar包就报这个错误了。
二
template might not exist or might not be accessible
翻译过来就是
模板可能不存在或者无法连接
这时候我在测试环境直接用静态资源找,是可以找到的。但是,走springmvc的话,就会报这个错误。
那么,很明显thymeleaf这个报错有问题。
三
完蛋啊,报错有问题的话,我怎么定位错误啊!!!
然后,我就逻辑短路了....
四
不用怕,我有百度。
直接用 template might not exist or might not be accessible去百度,然后找到的答案。大多数是这样的
其实这个问题也很好解决,我们只需要在引用模板文件的时候不用”/”打头就可以了,通过类似相对路径的方式来引用,但是需要说明的是,这里的相对路径仍然是相对于模板根目录来做的。
呃,问题是解决了,但是,我一直都是个钻牛角尖的人,,,
五
后面在一个远古的类似的报错推出了我想要的结果
Error resolving template “home”, template might not exist or might not be accessible by any of the configured Template Resolvers
例子之一 @RequestMapping(value = "/main")
public String toMain() {
String page = "/main";
return page;
} 其中的any of the configured Template Resolvers,指的就是全部的page
翻译过来就是 配置的模板解析器 那么显然就是/main出错了,根据springboot的默认thymeleaf配置,应该改成main
这么说的话thymeleaf报错没错啊,只是缩水了
也就是说
template might not exist or might not be accessible
这句异常全名可能是
template might not exist or might not be accessible by any of the configured Template Resolvers
可能国外的人以前老遇到这问题,已经一眼就知道说的是什么意思,所以thymeleaf就省略了后面那一串,,,,
六
那问题来了,为什么开发可以加/,jar包就不行了?
找了很久都没找到一个合适的解释啊,求大神解释一下....
Error resolving template: template might not exist or might not be accessible是一句缩水报错?的更多相关文章
- configure: error: Cannot find libmysqlclient under /usr Note that the MySQL client library is not bundled anymore! 报错解决
错误说明 今天在centos 6.3 64位版本上安装PHP5.4.3时在./configure 步骤的时候出现了下面错误configure: error: Cannot find libmysqlc ...
- MVC的Filters(拦截过滤)的Error页面,支持Ajax报错
报错拦截过滤到error页面 [AttributeUsage(AttributeTargets.Method | AttributeTargets.Class, Inherited = true, A ...
- sqlplus 连接数据库报错SP2-0642: SQL*Plus internal error state 2130, context 0:0:0
sqlplus 连接数据库报错SP2-0642: SQL*Plus internal error state 2130, context 0:0:0 问题描述: 使用sqlplus客户端登录数据库,报 ...
- [问题]编译报错:clang: error: linker command failed with exit code 1及duplicate symbol xxxx in错误解决方法之一
今天添加了一个新类(包括m,h,xib文件),还没有调用,-编译遇到如下错误,根据错误提示, duplicate symbol param1 in: /Users/xxxx/Library/Devel ...
- xtrabackup备份MySQL报错:InnoDB: Error number 24 means 'Too many open files'
xtrabackup备份MySQL报错:InnoDB: Error number 24 means 'Too many open files' 1.使用xtrabackup备份MySQL时出现如下报错 ...
- [报错]编译报错:clang: error: linker command failed with exit code 1及duplicate symbol xxxx in错误解决方法之一
今天添加了一个新类(包括m,h,xib文件),还没有调用,—编译遇到如下错误,根据错误提示, duplicate symbol param1 in: /Users/xxxx/Library/Devel ...
- 终极报错解决方案:Error:Execution failed for task ':app:processDebugManifest'. > Manifest merger failed with
遇到这个报错的时候,不要慌 Error:Execution failed for task ':app:processDebugManifest'. > Manifest merger fail ...
- sqlplus连接数据库报错SP2-0642: SQL*Plus internal error state 2130, context 0:0:0解决
sqlplus连接数据库报错SP2-0642: SQL*Plus internal error state 2130, context 0:0:0解决 sqlplus 连接数据库报错SP2-0642: ...
- MySQL5.6数据导入MySQL5.7报错:ERROR 1031 (HY000)
一.故障现象 今天将一个在MySQL5.7上的数据导入到MySQL5.6里面去,默认存储引擎都是InnoDB,导入报错如下: [root@oratest52 data]# mysql -uroot - ...
随机推荐
- ubuntu关闭cups服务
本人使用的ubuntu10.10每次开机时使用nmap扫描127.0.0.1的时候总是能发现一个631端口开启,在/etc/services找到 631端口是网络打印机服务,但对于我一个普通用户来说这 ...
- poj1637 Sightseeing tour[最大流+欧拉回路]
混合图的欧拉回路定向问题. 顺便瞎说几句,有向图定欧拉回路的充要条件是每个点入度等于出度,并且图联通.无向图的话只要联通无奇点即可. 欧拉路径的确定应该是无向图联通且奇点数0个或2个,有向图忘了,好像 ...
- CentOS6.6中安装VNC server(CentOS配置远程桌面)
1.安装服务 yum install tigervnc-server 1 2 名字有点怪哦,CentOS5前叫vnc-server 2.运行并设置密码 vncserver + 回车 1 2 输入密码, ...
- 前端PHP Session的实例
登陆例子:(请注意一定要自己敲一遍,不要CV大法) 首先上一下成果图,激起同学们写的欲望,登录页如下: 点击登陆之后如下: 说明哦了,么问题.接下来自己实现一下. 首先数据库信息: 新建一个名为 l ...
- Python3解leetcode Best Time to Buy and Sell Stock II
问题描述: Say you have an array for which the ith element is the price of a given stock on day i. Design ...
- QT画矩形
第一次发QT的博文,本人对QT接触没多久,还在入门水平,大牛勿喷哈,之前因为C# (.net framework)做出来的绘制矩形的程序闪的太厉害了,现在用QT重做一个 先上效果图 代码贴全了 #i ...
- 【243】◀▶IEW-Unit08
Unit 8 Environment I. 不定式(to do)在雅思写作中的运用 1)名词 • 主语(句首) To protect the environment is everyone's dut ...
- Deepin安装wxpython教程
环境: 安装报错: 解决: 1.sudo apt-get install libgtk-3-dev -y 2.sudo apt-get install freeglut3-dev libgstrea ...
- CodeForces 467D(267Div2-D)Fedor and Essay (排序+dfs)
D. Fedor and Essay time limit per test 2 seconds memory limit per test 256 megabytes input standard ...
- HTML5学习笔记(三)新属性、功能
HTML5 拖放 1.元素的 draggable 属性设置为 true 2.ondragstart 属性调用函数,函数中dataTransfer.setData() 方法设置被拖数据的数据类型和值 3 ...