异常现象:在本地打包部署完全没有问题,资源文件也都可以映射上,但是打包成jar包部署到服务器上时,就一直报异常,异常信息如下:

  1. 严重: Servlet.service() for servlet [dispatcherServlet] in context with path []
  2. threw exception [Request processing failed; nested exception is org.thymeleaf.ex
  3. ceptions.TemplateInputException: Error resolving template "/emailInfoManager/ema
  4. ilInfoList", template might not exist or might not be accessible by any of the c
  5. onfigured Template Resolvers] with root cause
  6. org.thymeleaf.exceptions.TemplateInputException: Error resolving template "/emai
  7. lInfoManager/emailInfoList", template might not exist or might not be accessible
  8. by any of the configured Template Resolvers
  9. at org.thymeleaf.TemplateRepository.getTemplate(TemplateRepository.java:
  10. 246)
  11. at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1104)
  12. at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1060)
  13. at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1011)
  14. at org.thymeleaf.spring4.view.ThymeleafView.renderFragment(ThymeleafView
  15. .java:335)

工程结构如下:

controller示例如下:

  1. @RequestMapping(value = "/findEmailInfoDataCriteria", method = RequestMethod.GET)
  2. public String findEmailInfoDataCriteria(@RequestParam(value = "page", defaultValue = "0") Integer page,
  3. @RequestParam(value = "size", defaultValue = "10") Integer size,
  4. @ModelAttribute("emailInfoData") EmailInfo emailInfo, ModelMap modelMap) {
  5. Page<EmailInfo> list = emailService.findEmailDataCriteria(page, size, emailInfo);
  6. modelMap.addAttribute("datas", list);
  7. return "/emailInfoManager/emailInfoList";
  8. }

经过大量的排查,最终的问题出在return "/emailInfoManager/emailInfoList";这行代码,去掉最前面的"/"就好了!

org.thymeleaf.exceptions.TemplateInputException: Error resolving template "/ template might not exist or might not be accessible by any of the configured的更多相关文章

  1. org.thymeleaf.exceptions.TemplateInputException: Error resolving template "/home/index2", template might not exist or might not be accessible by any of the configured Template Resolvers

    org.thymeleaf.exceptions.TemplateInputException: Error resolving template "/home/index2", ...

  2. org.thymeleaf.exceptions.TemplateInputException: Error resolving template 报错

    org.thymeleaf.exceptions.TemplateInputException: Error resolving template报错 遇到二次,第一次是刚刚学的时候,都是一个原因,而 ...

  3. springboot报 org.thymeleaf.exceptions.TemplateInputException: Error resolving template "succeed";

    --------------------- 本文转自 林晓风 的CSDN 博客 ,全文地址请点击:https://blog.csdn.net/Lin_xiaofeng/article/details/ ...

  4. Error resolving template,template might not exist or might not be accessible by any of the configured Template Resolvers

    template might not exist or might not be accessible by any of the configured Template Resolvers at o ...

  5. spring boot 使用thymeleaf模版 报错:org.thymeleaf.exceptions.TemplateInputException

    错误: org.thymeleaf.exceptions.TemplateInputException: Error resolving template "Hello", tem ...

  6. spring boot + thymeleaf 报错 org.thymeleaf.exceptions.TemplateInputException

    org.thymeleaf.exceptions.TemplateInputException: Error resolving template "admin/verifyPassword ...

  7. template might not exist or might not be accessible by any of the configured Template Resolvers at org.thymeleaf.engine.TemplateManager.resolveTemplate(TemplateManager.java:869)

    org.thymeleaf.exceptions.TemplateInputException: Error resolving template [code/leading], template m ...

  8. template might not exist or might not be accessible by any of the configured Template Resolvers

    距离上一篇文章已经很长时间了,最近太忙碌了,今天发布spring boot遇到一个问题,找了好久才找到解决办法,今天贴出来和大家一起分享下,首先看错误信息 HTTP Status 500 - Requ ...

  9. Spring Boot使用thymeleaf模板时报异常:template might not exist or might not be accessible by any of the configured Template Resolvers

    错误如下: template might not exist or might not be accessible by any of the configured Template Resolver ...

随机推荐

  1. mongodb 远程访问配置

    1.首先修改mongodb的配置文件 让其监听所有外网ip 编辑文件:/etc/mongodb.conf 修改后的内容如下: bind_ip = 0.0.0.0 port = 27017 auth=t ...

  2. MongoDB联合查询 -摘自网络

    1.简单手工关联 首先将结果查询出来放到一个变量里面,然后再查询 u = db.user.findOne({author:"wangwenlong"}); for(var p = ...

  3. Spring boot 通用配置文件模板

    # =================================================================== # COMMON SPRING BOOT PROPERTIE ...

  4. Atitit 项目管理 提升开发效率的项目流程方法模型 哑铃型  橄榄型 直板型

    Atitit 项目管理 提升开发效率的项目流程方法模型 哑铃型  橄榄型 直板型 项目主体三个部分 ui界面,中间层,数据库 按照不同的比重可以分为一下三个模型  哑铃型  橄榄型 直板型 哑铃型 开 ...

  5. 使用gm和imageMagick处理图片

    第一步安装imageMagick和gm模块 1, cnpm install --save imageMagick gm 第二步在服务器上安装imageMagick,下载地址http://www.ima ...

  6. Unable to load configuration. - [unknown location]

    严重: Exception starting filter StrutsPrepareFilterUnable to load configuration. - [unknown location] ...

  7. Sql Server 2000/2008 用Sql导出数据表结构(包括注释)到Excel

    --Sql Server 2000 declare @id int, ), ) declare cur_1 cursor for select id,name from sysobjects wher ...

  8. python(58):python下划线

    详解Python中的下划线 本文将讨论Python中下划线(_)字符的使用方法.我们将会看到,正如Python中的很多事情,下划线的不同用法大多数(并非所有)只是常用惯例而已. 单下划线(_) 通常情 ...

  9. linux命令(35):diff命令

    diff 命令是 linux上非常重要的工具,用于比较文件的内容,特别是比较两个版本不同的文件以找到改动的地方.diff在命令行中打印每一个行的改动.最新版本的diff还支持二进制文件.diff程序的 ...

  10. VirtualBox虚拟机网络环境解析和搭建-NAT、桥接、Host-Only、Internal、端口映射

    一.NAT模式 特点: 1.如果主机可以上网,虚拟机可以上网 2.虚拟机之间不能ping通 3.虚拟机可以ping通主机(此时ping虚拟机的网关,即是ping主机) 4.主机不能ping通虚拟机 应 ...