TemplateInputException:template might not exist or might not be accessible
2017-05-23 11:08
555 查看
Spring Boot 官网的介绍推荐的模板引擎Thymeleaf,使用上的确很方便,在IDEA或Eclipse中运行的时候,模板引入正常,但打成Jar包跑的时候,有时会报TemplateInputException
异常如下:
很纳闷!
来自stackoverflow有个解决的方案:
1.在application.yml 中添加配置
spring:
thymeleaf:
prefix:classpath:/templates/
2.th:include引入公共模板时注意头部不要加"/"
通过以上两步能基本解决Thymeleaf中模板引用和视图跳转报的TemplateInputException
解决方案来自:https://stackoverflow.com/questions/27249078/spring-boot-gives-templateinputexception-error-resolving-template-when-runnin
异常如下:
很纳闷!
来自stackoverflow有个解决的方案:
1.在application.yml 中添加配置
spring:
thymeleaf:
prefix:classpath:/templates/
2.th:include引入公共模板时注意头部不要加"/"
<aside class="aside-md hidden-print hidden-xs" id="nav" th:include="base/menu :: aside"></aside>
通过以上两步能基本解决Thymeleaf中模板引用和视图跳转报的TemplateInputException
解决方案来自:https://stackoverflow.com/questions/27249078/spring-boot-gives-templateinputexception-error-resolving-template-when-runnin
相关文章推荐
- 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
- 解决Error resolving template template might not exist or might not be accessible问题
- Spring Boot使用thymeleaf模板时报异常:template might not exist or might not be accessible by any of the configured Template Resolvers
- template might not exist or may 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
- [TroubleShooting] The server network address can not be reached or does not exist
- The plugin 'org.apache.maven.plugins:maven-eclipse-plugin' does not exist or no valid version could be found 解决
- [TroubleShooting] The server network address can not be reached or does not exist
- yii2框架刚安装上报The file or directory to be published does not exist: /home/wwwroot/advanced/vendor/bower
- spark-shell on yarn 出错(arn application already ended,might be killed or not able to launch applic)解决
- yii2 The file or directory to be published does not exist
- 关于Service 'XXXX' of type 'MapServer' does not exist or is inaccessible问题的解决
- 安装Yii碰到“the file or directory to be published does not exist bower/jquery/dist”
- Maven 创建项目的时候 [INFO] The plugin 'org.apache.maven.plugins:maven-archetype-plugin' does not exist or no valid version could be fo
- 关于 Database Mail 配置时出现的错误 - The configuration option 'Database Mail XPs' does not exist, or it may be an advanced option.
- Yii2: the file or directory to be published does not exist bower/jquery/dist
- hadoop1.1.2格式化出错:*is in an inconsistent state: storage directory does not exist or is not accessible
- vc6.0 编译通过,运行时出现:one or more files are out of date or not exist ,These files need to be bulit.
- System.Security.SecurityException The source was not found, but some or all event logs could not be searched.Inaccessible logs Security.