zoukankan      html  css  js  c++  java
  • org.thymeleaf.exceptions.TemplateInputException: Error resolving template "/ template might not exist or might not be accessible by any of the configured

    异常现象:在本地打包部署完全没有问题,资源文件也都可以映射上,但是打包成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";这行代码,去掉最前面的"/"就好了!

     

  • 相关阅读:
    wtl 支持托拽文件并在ListBox框中显示文件路径的方法
    提升本程序进程优先级和权限(VC++源代码)
    Win7下运行VC程序UAC权限问题
    Flex中带for的循环
    Flex注释
    Flex建立编译环境
    Flex事件驱动机制
    Flex应用程序的系统开发周期
    Linux下c开发 之 线程通信
    将 Win32 C/C++ 应用程序迁移到 POWER 上的 Linux,第 1 部分: 进程、线程和共享内存服务
  • 原文地址:https://www.cnblogs.com/hfultrastrong/p/8890718.html
Copyright © 2011-2022 走看看