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是一句缩水报错?的更多相关文章

  1. 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 ...

  2. MVC的Filters(拦截过滤)的Error页面,支持Ajax报错

    报错拦截过滤到error页面 [AttributeUsage(AttributeTargets.Method | AttributeTargets.Class, Inherited = true, A ...

  3. 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客户端登录数据库,报 ...

  4. [问题]编译报错:clang: error: linker command failed with exit code 1及duplicate symbol xxxx in错误解决方法之一

    今天添加了一个新类(包括m,h,xib文件),还没有调用,-编译遇到如下错误,根据错误提示, duplicate symbol param1 in: /Users/xxxx/Library/Devel ...

  5. 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时出现如下报错 ...

  6. [报错]编译报错:clang: error: linker command failed with exit code 1及duplicate symbol xxxx in错误解决方法之一

    今天添加了一个新类(包括m,h,xib文件),还没有调用,—编译遇到如下错误,根据错误提示, duplicate symbol param1 in: /Users/xxxx/Library/Devel ...

  7. 终极报错解决方案:Error:Execution failed for task ':app:processDebugManifest'. > Manifest merger failed with

    遇到这个报错的时候,不要慌 Error:Execution failed for task ':app:processDebugManifest'. > Manifest merger fail ...

  8. 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: ...

  9. MySQL5.6数据导入MySQL5.7报错:ERROR 1031 (HY000)

    一.故障现象 今天将一个在MySQL5.7上的数据导入到MySQL5.6里面去,默认存储引擎都是InnoDB,导入报错如下: [root@oratest52 data]# mysql -uroot - ...

随机推荐

  1. 取分组TOPN好理解案例

  2. Swift范性

    关于泛型 「泛型」(Generic Code)也许是Swift相对于OC的最大特性之一吧!基于Swift的「泛型」特性,你能够写出扩展性更强.复用性更强的方法.类型,它可以让你尽可能避免重复代码,用一 ...

  3. ACM学习历程—HDU 1272 小希的迷宫(并查集)

    Description 上次Gardon的迷宫城堡小希玩了很久(见Problem B),现在她也想设计一个迷宫让Gardon来走.但是她设计迷宫的思路不一样,首先她认为所有的通道都应该是双向连通的,就 ...

  4. BZOJ1758:[WC2010]重建计划

    浅谈树分治:https://www.cnblogs.com/AKMer/p/10014803.html 题目传送门:https://www.lydsy.com/JudgeOnline/problem. ...

  5. POJ3159(最短路)

    Candies Time Limit: 1500MS   Memory Limit: 131072K Total Submissions: 27051   Accepted: 7454 Descrip ...

  6. PHP 文件导出(Excel, CSV,txt)

    PHPExcel: 可以在我的文件中下载phpexcel放到项目中用!! 1,Excel 导出: /** * Excel导出例子 */ public function excel($res){ $ob ...

  7. 双击jar不能运行的解决方法

    1.问题描述     使用eclipse导出jar.双击jar文件弹出一个内容为“a java exception has occurred”的错误警告提示! 但是在命令行用 java -jar Em ...

  8. Django 框架

    MVC 框架和MTV框架  (了解即可) MVC,全名是Model View Controller,是软件工程中的一种软件架构模式,把软件系统分为三个基本部分:模型(Model).视图(View)和控 ...

  9. MS SQL JSON类型type

    在MS SQL Server 2016,已经支持JSON处理. 执行下面代码,将获取ms sql server对象类型以及其说明: IF OBJECT_ID('tempdb.dbo.#json_typ ...

  10. java反射机制基础总结

    1反射机制是啥? 反射是运行中的程序检查自己和软件运行环境的能力,它可以根据它发现的进行改变.通俗的讲就是反射可以在运行时根据指定的类名获得类的信息. 2反射机制有啥用? Reflection(反射) ...