文章目录

  • 1. 导入依赖
  • 2. 配置
  • 2. 视图层
  • 3. 创建页面
  • 4. 检查target
  • 5. 表达式

使用Thymeleaf 一共5步,检查一下看看是否符合规范

1. 导入依赖
   <!--模板引擎--><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-thymeleaf</artifactId></dependency>
2. 配置

application.properties

# thymeleaf相关配置
spring.thymeleaf.prefix=classpath:/templates/
spring.thymeleaf.suffix=.html
2. 视图层

做路径跳转

package com.imooc.dianping.controller.admin;import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;@Controller
@RequestMapping("/admin/admin")
public class AdminController {@GetMapping("/index")public ModelAndView index() {ModelAndView modelAndView = new ModelAndView("/admin/admin/index");return modelAndView;}
}
3. 创建页面

默认:在templates目录下面创建页面
根据业务需求,在templates创建子包路径,和视图层相对应

4. 检查target

检查文件是否编译

5. 表达式
<p th:text="${name}"></p>

Thymeleaf Error resolving template [index],template might not exist or might not be accessible相关推荐

  1. SpringBoot:Error resolving template [index], template might not exist or might not be acce...解决方法

    SpringBoot异常:Error resolving template [index], template might not exist or might not be accessible b ...

  2. Springboot 报错 Error resolving template [index]

    控制台报错: Error resolving template [index], template might not exist or might not be accessible by any ...

  3. Error resolving template [], template might not exist or might not be accessible by any of the conf

    一.问题: Error resolving template [/index], template might not exist or might not be accessible by any ...

  4. ElasticSearch 系列: Index Template

    Index template Index template定义在创建新index时可以自动应用的settings和mappings. Elasticsearch根据与index名称匹配的index模式 ...

  5. SpringBoot(二)Error resolving template “xxx”, template might not exist or might not be accessible解决办法

    SpringBoot 7 SpringBoot整合持久层技术 7.1 整合JDBC 7.1.1 修改pom文件 <?xml version="1.0" encoding=&q ...

  6. 解决Error resolving template [x] template might not exist or might not be accessible by any of the con

    文章目录 1. 复现问题 2. 分析问题 2.1 检查pom依赖 2.2 详解thymeleaf引擎 2.2 检查yml配置 3. 解决问题 1. 复现问题 今天配置好shiro + jwt后,可以正 ...

  7. exception processing, template error resolving template

    exception processing, template error resolving template 错误信息:Exception processing template "/vi ...

  8. TemplateInputException: Error resolving template 无法解析页面原因记录

    报错如下: TemplateInputException: Error resolving template [search], template might not exist or might n ...

  9. IDEA中进行SpringBoot开发时提示:Error resolving template xxx, template might not exist or might not be acce

    场景 IDEA中进行SpringBoot开发时提示: Error resolving template "xxx", template might not exist or mig ...

最新文章

  1. python 报错 IndentationError: expected an indented block SyntaxError: invalid character in identifie
  2. python是软件吗-python运行环境是什么
  3. 18python入门到精通_《Python从入门到精通(60课)》18 序列类型之元组
  4. linux ls 输出对齐,理解 Linux 中 `ls` 的输出
  5. Laravel的Class Laravel\Passport\Passport not found
  6. Android中AutoCompleteTextView的特殊使用方法
  7. 天梯 L2 这是二叉搜索树吗?
  8. Qt笔记-QSslSocket双向认证
  9. 苹果x来电闪光灯怎么设置_苹果6splus来电没有声音,苹果6sp听筒没有声音怎么回事...
  10. JAVAIO流经验总结
  11. Atitit.aticmd v4  新特性q39 添加定时器释放功能
  12. JS递归算法经典案例与分析
  13. 编译时的chenk api
  14. 每天一句英语(有道)
  15. 【微信小程序】设置画布字体
  16. 考研路上的那些一战二战三战成功与失败的故事系列之一
  17. LocalDate的用法与String互转
  18. 例7.6有5个学生坐在一起,问第5个学生多少岁,他说比第4个学生大2岁。
  19. golang中的gin框架学习
  20. 数据分析之拉勾网(三)

热门文章

  1. 到达什么水平才能算是学会了数学?
  2. 古人把月球叫做广寒宫,古人是怎么知道月球上很冷的?一起来看看
  3. 推荐系统--矩阵分解(5)
  4. Hadoop视频教程资源链接
  5. java Switch里面的类型问题
  6. Databricks 企业版 SparkDelta Lake 引擎助力 Lakehouse 高效访问
  7. 聚焦业务价值:分众传媒在 Serverless 上的探索和实践
  8. 一场关于动态化开发实践的技术探讨
  9. 维大杀器来了,未来云上服务器或将实现无人值守
  10. 阿里云助力浙江大学信息化建设,以实时数据驱动校园智能管理