异常现象:在本地打包部署完全没有问题,资源文件也都可以映射上,但是打包成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. 修改 Semantic UI 中对 Google 字体的引用

    在第一次尝试 Semantic UI 后,发现其 css 中第一行,就引用了 fonts.googleapis.com 中的字体. 不知道为什么要这么做,也许在国外,google 的服务已经是一种互联 ...

  2. openssl之EVP系列之13---EVP_Open系列函数介绍

    openssl之EVP系列之13---EVP_Open系列函数介绍     ---依据openssl doc/crypto/EVP_OpenInit.pod翻译和自己的理解写成     (作者:Dra ...

  3. 关于checkbox选中问题总结

    (1)ng-checked的值只是用来决定初始状态时选中还是为选中,ng-model  才是随着复选框是否被选中,来实时改变它绑定变量的值. (2)如果初始状态ng-checked和ng-model指 ...

  4. 每日英语:Can Robots Better Spot Terrorists at Airports?

    Next to have their jobs automated: airport-security screeners? Aviation and government authorities a ...

  5. 此编译单元不包含在frame元数据中指定的factoryClass,无法加载配置的运行时共享库

    警告:此编译单元不包含在frame元数据中指定的factoryClass,无法加载配置的运行时共享库.要在没有运行时共享库的情况下进行编译,请将 -static-link-runtime-shared ...

  6. Kafka 协议实现中的内存优化【转】

    Kafka 协议实现中的内存优化   Jusfr 原创,转载请注明来自博客园 Request 与 Response 的响应格式 Request 与 Response 都是以 长度+内容 形式描述, 见 ...

  7. java8的新特性以及用法简介

    1. 介绍 2 接口的默认方法 2 lambda表达式 2.1 函数式接口 2.2 方法与构造函数引用 2.3 访问局部变量 2.4 访问对象字段与静态变量 3. 内建函数式接口 3.1 Predic ...

  8. 【Android】OAuth验证和新浪微博的oauth实现

    关于OAuth验证 OAuth是当下流行的授权方案,twitter,facebook,google等大型网站的开放平台都支持了oauth验证模式,国内的新浪微博.腾讯微博.163微博的开放平台也相继支 ...

  9. 【内核】内核链表使用说明,list.h注释

    list_entry定义 /** * list_entry - get the struct for this entry * @ptr: the &struct list_head poin ...

  10. ADB Fix error : insufficient permissions for device

    Ubuntu 15中在使用中Android开发板时,命令行下输入adb devices.adb shell会提示insufficient permissions for device. 通常重启下ad ...