thymeleaf报错的解决方法

org.thymeleaf.exceptions.TemplateInputException: Error resolving template "index", template might not exist or might not be accessible by any of the configured Template Resolvers
    at org.thymeleaf.TemplateRepository.getTemplate(TemplateRepository.java:246) ~[thymeleaf-2.1.5.RELEASE.jar:2.1.5.RELEASE]
    at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1104) ~[thymeleaf-2.1.5.RELEASE.jar:2.1.5.RELEASE]
    at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1060) ~[thymeleaf-2.1.5.RELEASE.jar:2.1.5.RELEASE]
    at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1011) ~[thymeleaf-2.1.5.RELEASE.jar:2.1.5.RELEASE]
    at 。。。。

thymeleaf报错的解决方法_第1张图片


这个报错主要是由于 thymeleaf 2.x版本 必须强制实现完全的html

thymeleaf报错的解决方法_第2张图片

报错位置略微有点不准确 只需要在红线处 将 /> 补全就好

补全后 idea 按 Crtl + F9 重新build一下 刷新页面就好

你可能感兴趣的:(thymeleaf)