Error resolving template [], template might not exist or might not be accessible by any of the conf
一、问题:
Error resolving template [/index], template might not exist or might not be accessible by any of the configured Template Resolvers
- 出现在 SpringBoot 项目使用
java -jar
运行时
二、解决
- 分别检查下面三个地方
2.1 在 pom.xml 中添加 thymeleaf 依赖
- 没有的话加下,有的话不用加
<dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
2.2 application.yml添加相应的thymeleaf 的配置
- 我原先的配置不全,是错误的
- 需要修改成下面这样
thymeleaf:prefix: classpath:/templates/ #prefix:指定模板所在的目录check-template-location: true #check-tempate-location: 检查模板路径是否存在cache: false #cache: 是否缓存,开发模式下设置为false,避免改了模板还要重启服务器,线上设置为true,可以提高性能。suffix: .html#encoding: UTF-8#content-type: text/htmlmode: HTML5
- 示例图(方便大家对应着看)
2.3 访问路径 @controller 的类
- 记住,页面需要以 ModelAndView 对象的形式放回
@RequestMapping("/")public ModelAndView indexHtml(HashMap<String, Object> map) {ModelAndView mv = new ModelAndView("index");return mv;}
- 对于 index 的路径我是这样的,大家可以对照下
- 到这里从新跑一下就能解决啦~ cheers~
三、总结
- 如果还有问题可以截图私聊我,我有时间的话可以帮大家看看
- 如果本文对你有用,欢迎点赞活着关注支持,因为这是对我最大的鼓励
Error resolving template [], template might not exist or might not be accessible by any of the conf相关推荐
- IDEA中进行SpringBoot开发时提示:Error resolving template xxx, template might not exist or might not be acce
场景 IDEA中进行SpringBoot开发时提示: Error resolving template "xxx", template might not exist or mig ...
- 异常:Error resolving template “xxx“, template might not exist or might not be accessible...解决办法
异常:Error resolving template "xxx", template might not exist or might not be accessible...解 ...
- SpringBoot(二)Error resolving template “xxx”, template might not exist or might not be accessible解决办法
SpringBoot 7 SpringBoot整合持久层技术 7.1 整合JDBC 7.1.1 修改pom文件 <?xml version="1.0" encoding=&q ...
- 解决:Error resolving template [/xxx], template might not exist or might not be accessible by any of th
问题描述 Error resolving template [/xxx], template might not exist or might not be accessible by any of ...
- Error resolving template “xxx“, template might not exist or might错误记录
项目场景: SpringMVC项目在Windows下启动,访问正常.打成jar包后,在linux下访问报错 问题描述 Error resolving template "xxx", ...
- SpringBoot:Error resolving template [index], template might not exist or might not be acce...解决方法
SpringBoot异常:Error resolving template [index], template might not exist or might not be accessible b ...
- 异常:Error resolving template xxx, template might not exist or might not be accessible...解决办法
简单表述:控制台出现了这个异常:Error resolving template "xxx", template might not exist or might not be a ...
- 解决Error resolving template [x] template might not exist or might not be accessible by any of the con
文章目录 1. 复现问题 2. 分析问题 2.1 检查pom依赖 2.2 详解thymeleaf引擎 2.2 检查yml配置 3. 解决问题 1. 复现问题 今天配置好shiro + jwt后,可以正 ...
- Error resolving template XXX, template might not exist or might not be accessible by any of the.....
提示:本案例或许只适合本项目!不要盲目相信本博客,但可值得一试 就像生病吃药,吃这个药或许不会好,吃那个药会好一样 文章目录 项目场景: 原因分析: 解决方案: 项目场景: 提示:这里简述项目相关背景 ...
最新文章
- VClient 无法连接Vcenter
- 大数据:从入门到XX(一)
- 分区数据导出功能(页面调整)
- JavaScript:JavaScript中常见获取对象元素的方法
- MiniDao持久层 Vs Mybatis
- 吴恩达神经网络和深度学习-学习笔记-41-特征点检测
- HDU 4371 Alice and Bob
- 高中计算机课程事例,[案例教学法在高中信息技术教学中的应用] 教学案例分析100例...
- SAP+条码系统软件是如何优化仓库库存管理?
- Mac下Jmeter基本使用
- 根据一学期的学习,谈谈你对软件工程学科的认识。
- 为什么总说程序员是吃青春饭的? 32岁程序员直接被面试官送走?
- Javaweb(二)制作调查问卷
- 算法设计——用分治法查找数组元素的最大值和最小值、用分治法实现合并排序、最小费用问题、树的最大连通分支问题(代码实现)
- 小程序获取用户唯一id php_微信小程序配合PHP获取用户OpenID标识
- Oracle同一字段有数字和字母时进行排序
- AOP入门案例(切入点及表达式)
- 九度 题目1335:闯迷宫 题目1365:贝多芬第九交响曲
- 恢复计算机管理员权限软件,帮您修复win10系统管理员权限的恢复步骤
- 牛逼,个人开发者可以申请微信支付了
热门文章
- 百度云android平板,百度网盘hd版本下载-百度网盘hd平板版本下载v11.6.3 安卓官方版-2265安卓网...
- 从五个方面解说:数字技术对就业的有怎样的影响,你知道吗?
- 基于eclipse的android项目实战—博学谷(新功能五)更换头像
- 二分图二•二分图最大匹配之匈牙利算法
- 计算机本科核心课程教学视频,绝对经典(28门核心视频课程)
- 听起来你的咕噜功能虽然您当前的赚取加盟文凭在线
- 亚马逊跨境电商美国站店铺产品运营是什么?亚马逊美国站店铺产品开发主要做什么?
- Qt编写安防视频监控系统42-用户权限
- 自动驾驶中间件之二:通信中间件,DDS与SOME/IP 谁主沉浮?
- 高级技巧之vertical-align属性应用
- IDEA中进行SpringBoot开发时提示:Error resolving template xxx, template might not exist or might not be acce