异常现象:在本地打包部署完全没有问题,资源文件也都可以映射上,但是打包成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. mapreduce 只使用Mapper往多个hbase表中写数据

    只使用Mapper不使用reduce会大大减少mapreduce程序的运行时间. 有时候程序会往多张hbase表写数据. 所以有如题的需求. 下面给出的代码,不是可以运行的代码,只是展示driver中 ...

  2. 使用C# 链接 Mysql 显示??? 乱码 的解决方案

    下载以下文件 mysql-connector-odbc-5.3.6-win32.msi 下载并打开以下文件: mysql-installer-community-5.6.28.0.msi 安装mysq ...

  3. 《深入理解jvm》笔记---第六章

    类文件结构 1. Java一次编写,到处执行的基石:    Java编译产生的是字节码(bytecode).sun公司和其它虚拟机提供商公布各个平台上的虚拟机.这些虚拟机能够加载和执行这些与平台无关的 ...

  4. android 的build.gradle 的API手册

    问题:对于用gradle的来配置java的开发者都能在GRADLE_HOME/docs/dsl找到如何对其build.gradle文件的具体属性. 但是对于开发android的开发者就不能对于官方的& ...

  5. 临摹一个像素风格高楼shader

    原始效果地址:http://glslsandbox.com/e#40050.0 是一个的城市高楼感的shader,比较像素风 可以拿来做游戏背景,或者基于这个思路做一些别的效果 这个是我后来找的版本, ...

  6. 【Unity】8.4 扩展UnityGUI

    分类:Unity.C#.VS2015 创建日期:2016-04-27 一.简介 有很多种方法可以补充和扩展 UnityGUI 以满足您的需求.你可以混合和创建控件,并且可以有多种方法来规定用户 GUI ...

  7. webp技术探索

    不管是 PC 还是移动端,图片一直是流量大头,以苹果公司 Retina 产品为代表的高 PPI 屏对图片的质量提出了更高的要求,如何保证在图片的精细度不降低的前提下缩小图片体积,成为了一个有价值且值得 ...

  8. 【小白的CFD之旅】22 好网格与坏网格

    网格疏密网格形状其他的一些问题小白的总结郑重申明 网格的作用如此重要,以至于小白纠结了很久.小白知道网格划分过程很大程度上受制于计算资源的限制,但小白还是不太明白,如果计算资源非常充足,不用顾忌资源限 ...

  9. 每日英语:How to Solve India's Huge Food Wastage

    India is one of the world’s  largest producers of fruits and vegetables, but a third of its produce ...

  10. 使用FastJson从json串中根据key获取value

    import com.alibaba.fastjson.JSONObject; /** * Created by SYJ on 2017/9/13. */ public class MainTest ...