Error resolving template [xxx], template might not exist or might not be exist

Springboot+thymeleaf+mybatis 抛Error resolving template [xxx], template might not exist的异常

原因是我们在pom.xml增加的以下内容导致的,以下内容中src/main/resources这项中没有把你的html文件包括进去,懒一点的做法(<include>**/*.*</include>),


<resources>    <resource>        <targetPath>${project.build.directory}/classes</targetPath>        <directory>src/main/resources</directory>        <filtering>true</filtering>        <includes>            <include>**/*.yml</include>            <include>**/*.xml</include>        </includes>    </resource>    <resource>        <targetPath>${project.build.directory}/classes</targetPath>        <directory>src/main/java</directory>        <includes>            <include>**/*.*</include>            <include>**/*.xml</include>        </includes>    </resource></resources>
还有增加整段内容的目的是为了解决另一个问题,扫描不到mybatis的mapper.xml文件(在调用Mapper层方法时报错:Invalid bound statement (not found)),增加在最后面的<build></build>之间

 

 

原文地址:https://www.cnblogs.com/freestudy/p/10348856.html

时间: 2024-07-29 18:43:59

Error resolving template [xxx], template might not exist or might not be exist的相关文章

异常:Error resolving template &quot;xxx&quot;, template might not exist or might not be accessible...解决办法

简单表述:控制台出现了这个异常:Error resolving template "xxx", template might not exist or might not be accessible by any of the configured Template Resolvers 解决办法:在报出这个异常的方法上添加注解@ResponseBody 讲一下个人理解:这个注解就是用来区别 方法的返回值字符串 和 视图解析器解析的页面名字字符串 的冲突的,举个例子:方法A返回的字符串s

thymeleaf在开发环境正常,但用jar运行时报错 Error resolving template template might not exist or might not be accessible

通过打包 jar直接运行的 百度搜索此关键词找到的:“springboot jar error resolving template” 原因是指向模板的路径前有斜杆/,就会出错,去掉就正常了(路径前不能带斜杆,类似相对路径的写法) 网上有人说增加配置spring.thymeleaf.prefix=classpath:/templates也能解决 原文地址:https://www.cnblogs.com/kinome/p/11509248.html

Thymeleaf 异常:Exception processing template &quot;index&quot;: An error happened during template parsing (template: &quot;class path resource [templates/index.html]&quot;)

Spring Boot 项目,在 Spring Tool Suite 4, Version: 4.4.0.RELEASE 运行没有问题,将项目中的静态资源和页面复制到 IDEA 的项目中,除了 IDE 不同,其他基本相同. 运行 IDEA 中的项目,然后访问,出现异常: Exception processing template "index": An error happened during template parsing (template: "class path

【报错】An error happened during template parsing (template: &quot;class path resource [templates/hello1.html]&quot;)

页面显示: Whitelabel Error Page This application has no explicit mapping for /error, so you are seeing this as a fallback. Fri Dec 06 23:26:03 CST 2019 There was an unexpected error (type=Internal Server Error, status=500). An error happened during templ

go text/template html/template invalid memory address or nil pointer dereference

2017/08/14 20:06:10 http: panic serving 172.22.27.131:56324: runtime error: invalid memory address or nil pointer dereference goroutine 19 [running]: net/http.(*conn).serve.func1(0xc420171e00) /usr/local/go/src/net/http/server.go:1693 +0xd0 panic(0x7

Error setting expression &#39;XXX‘&#39;[Ljava.lang.with value &#39;[Ljava.lang.String;@10101fb&#39;

ognl报的警告,说明你的格式错误,一般是日期格式错误,格式转换器的应用,id设置的类型不对String 类型,输入了Int类型所以方法一是改变这个类中的id的属性 然后get和set也跟着改变 另一个问题可能是配置文件的位置放错了,我就是这个原因,配置文件要放在被配置的类的那个文件夹内,而不是src中 放在action包当中,我就是这个问题,希望对您有帮助. Error setting expression 'XXX''[Ljava.lang.with value '[Ljava.lang.S

[MacOS] xcrun: error: active developer path (&quot;/Volumes/Xcode/Xcode6-Beta.app/Contents/Developer&quot;) does not exist, use xcode-select to change

When using MacOS with xcode6-beta, i always meet these error: xcrun: error: active developer path ("/Volumes/Xcode/Xcode6-Beta.app/Contents/Developer") does not exist, use xcode-select to change After googled, i found the solution. sudo xcode-se

解决CentOS7下运行docker容器时出现的报错Error resolving syscall name...

最近在研究docker!在虚拟机centos7中运行docker经常会有: [[email protected] docker]$ docker run -it lin/centos6 /bin/bash 2016/11/08 19:38:53 Error resolving syscall name execveat: could not resolve name to syscall - ignoring syscall. 2016/11/08 19:38:53 Error resolvin

mysql 1130 ERROR 1130: Host xxx.xxx.xxx.xxx is not allowed to connect to this MySQL server

mysql -u root -p  mysql;use mysql;  mysql;select 'host' from user where user='root';  mysql;update user set host = '%' where user ='root';  mysql;flush privileges; mysql 1130 ERROR 1130: Host xxx.xxx.xxx.xxx is not allowed to connect to this MySQL se