异常:Error resolving template "xxx", template might not exist or might not be accessible...解决办法
在开发环境下正常,但使用jar运行时,报错Error resolving template template might not exist or might not be accessible,意思是模板页不在,但在jar里存在该模板页
1.查看pom.xml文件是否添加
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
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/html
mode: HTML5
3.看你的页面路径地址

4.①的访问路径 直接 localhost:8080 + 你页面地址
②的访问路径 在controller
@Controller
@RequestMapping("demo")
public class LoginCtrl { @RequestMapping("/demo3")
public ModelAndView login(){
ModelAndView mv = new ModelAndView("temp");
return mv;
} }

③ 的访问路径跟②一致,不过
ModelAndView mv = new ModelAndView("/back/bcak");
异常: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 exist
Springboot+thymeleaf+mybatis 抛Error resolving template [xxx], template might not exist的异常 原因是我们在pom. ...
- maven Error resolving version for plugin 'org.apache.maven.plugins:maven-eclipse-plugin' from the repositories 解决
报错:Error resolving version for plugin 'org.apache.maven.plugins:maven-eclipse-plugin' from the repos ...
- Sql Server 备份还原失败错误ERROR:3145(备份集中的数据库备份与现有的数据库不同)及解决办法
SQL Server备份文件bak,备份后还原出现错误3145,备份集中的数据库备份与现有的 'xxx' 数据库不同. 解决办法如下: 1,新建一个与现有数据库重名的数据库. 如果您不知道数据库名称, ...
- Error building Player: Win32Exception: ApplicationName=‘xxxxxxxxxxxxxxxxxx//sdk\tools\zipalign.exe' , CommandLine='4 的解决办法
更新了安卓SDK后,有时候Unity编译失失败,报错类似 Error building Player: Win32Exception: ApplicationName='D:/Program File ...
- MySQL:Error : Tablespace for table '`database`.`temp`' exists. Please DISCARD the tablespace before IMPORT.解决办法
今天在navicat上操作mysql数据库表,突然没有响应了.随后重启,mysql服务也终止了.随后启动服务,检查表,发现一张表卡没了,就重新添加一张表.报了一个错: Error : Tablespa ...
- 执行HBase shell时出现ERROR: org.apache.hadoop.hbase.ipc.ServerNotRunningYetException: Server is not running yet错误解决办法(图文详解)
不多说,直接上干货! [kfk@bigdata-pro01 bin]$ jps NameNode ResourceManager JournalNode HMaster DataNode HRegio ...
- error: Failed to start domain lb error: Failed to activate service 'org.freedesktop.machine1': timed out 报错的解决办法
能正常查看kvm虚拟机列表: virsh list 但在执行virsh start lb启动虚拟机时卡顿了好几秒,然后报以下错误: error: Failed to start domain lber ...
- 【SpringBoot+Mybatis+thymeleaf报错】Error resolving template "XXX", template might not exist or might not be accessible by any of the configured
解决方法一: 原因:在使用springboot的过程中,如果使用thymeleaf作为模板文件,则要求HTML格式必须为严格的html5格式,必须有结束标签,否则会报错. 在application.y ...
- 无法打开物理文件 XXX.mdf",操作系统错误 5:"5(拒绝访问。)"的解决办法
http://blog.csdn.net/blackfield/article/details/6550499 用T-SQL命令附加数据库时,出现如下异常信息: 无法打开物理文件 XXX.mdf&qu ...
随机推荐
- JavaIO流——简单对文件的写入及读取(一)
IO,即Input(输入)和Output(输出)的首字母缩写. 在编程语言的I/O类库中常使用流这个抽象概念.它代表任何有能力产出数据的数据源对象或者是与能力接收数据的接收端对象.“流”屏蔽了实际的I ...
- 爬取豆瓣电影影评,生成wordcloud词云,并利用监督学习根据评论自动打星
本文的完整源码在git位置:https://github.com/OceanBBBBbb/douban-ml 爬取豆瓣影评 爬豆瓣的影评比较简单,豆瓣没有做限制,甚至你都不用登陆就可以看全部,我这里用 ...
- (转载记录)Active Directory 灾难恢复
部分适用于Windows Server 2003. 在IT环境中谁也不能保证软硬件永远没有故障:那么就需要我们IT能够未雨绸缪,尽量避免故障发生,如果故障发生了,我们需要把损失降到最小:那么就需要我们 ...
- 解决c# progressBar更新出现界面假死
最近一个项目需求中的一个功能是需要用progressBar反映处理文件的进度. 研究了Invoke和BeginInvoke方法. Control.Invoke 方法 (Delegate) :在拥有此控 ...
- mysqlworkbench访问远程服务器
1.如果服务器有防火墙,需要关一下: systemctl stop firewalld.service #停止firewallsystemctl disable firewalld.service # ...
- arcgis for js 根据多边形自动缩放
交代背景:多边形已经渲染在图层上,然后根据多边形自动缩放值合适的大小: 思路:获取图层信息,获取图层中的几何信息,获取图形范围信息,在地图上设置范围:(下面的方法有封装)记一下思路就好 var pol ...
- BeautifulReport 实现app UI自动化测试
修改了 BeautifulReport源码中的一些内容<附:BeautifulReport--适用于unittest自动化测试的可视化报告>; 1.生成截图时,原来的img文件夹必须在项目 ...
- 原创《weex面向未来的架构》
最近一直在做weex的调研工作,整理之后给公司做了一次技术分享. 分享内容如下: 1:Weex是什么? 2: Weex目前能做什么? 3: Weex 如何调试 4: 剖析一下Weex原理 5: ...
- Bugku-CTF之flag.php(点了login咋没反应)
Day20 flag.php 地址:http://123.206.87.240:8002/flagphp/ 点了login咋没反应 提示:hint
- Codeforces Gym 101190M Mole Tunnels - 费用流
题目传送门 传送门 题目大意 $m$只鼹鼠有$n$个巢穴,$n - 1$条长度为$1$的通道将它们连通且第$i(i > 1)$个巢穴与第$\left\lfloor \frac{i}{2}\rig ...