Error resolving template [], template might not exist or might not be accessible by any of the conf

今天使用模版引擎thymeleaf编写了一个springboot项目

打包成jar后使用java -jar 包名.jar

启动之后 使用浏览器访问时候 出现了该问题

经过一番查找,发现了是路径的问题

controller中跳转到页面时我使用的路径如下

image-20211126133420300

但在jar包运行下,就有问题了将/去掉后再打jar包就可以正常查看了

image-20211126133524684

重定向还是要加上/的

image-20211126133600610

 

posted @ 2021-11-26 13:36  2333gyh  阅读(713)  评论(0编辑  收藏  举报