首页 > 其他分享 >spring boot thymeleaf 不能访问templates目录下的页面问题

spring boot thymeleaf 不能访问templates目录下的页面问题

时间:2022-08-19 19:01:54浏览次数:99  
标签:templates spring boot 访问 thymeleaf 页面

springboot默认情况下可以直接访问四个目录下的静态文件(https://www.cnblogs.com/realzhaijiayu/p/16566667.html)
public
static
resources
META-INF/resources

引入 thymeleaf 之后才能访问 templates 目录下的静态页面,不能访问的原因是引入的 thymeleaf 的依赖有问题

<dependency>                                             <!--3-->
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-thymeleaf</artifactId>
    <version>2.7.2</version>
</dependency>

标签:templates,spring,boot,访问,thymeleaf,页面
From: https://www.cnblogs.com/realzhaijiayu/p/16603063.html

相关文章

  • SpringWebflux框架里导出excel文档
    本demo里使用springboot2.7.0版本。@GetMapping("/download/excel/file")publicMono<Void>downloadExcelFile(ServerHttpResponseresponse,WebSessionwebSessi......
  • spring5 ioc 管理bean 注解
    1.注解种类@Component(value="student")@Service@Repository@Controller 2.使用注解扫描包<context:component-scanbase-package="com.cj"></context:componen......
  • 【文件上传】Spring MVC 文件上传
    (1)文件上传三要素:1、表单的提交方式method="POST"2、表单的enctype属性是多部分表单形式enctype=“multipart/form-data"3、表单项(元素)type="file"<formaction=""m......
  • SpringBoot集成Swagger
    一、pom.xml中引入如下依赖:<!--swagger2--><dependency><groupId>io.springfox</groupId><artifactId>springfox-swagger2</arti......
  • SpringCloud学习之注册中心搭建过程中的一些问题
    问题1 解决方案:这个问题需要在application.properties里添加 hostname这项配置,奇葩的是这个地方只能配localhost,配成其他值一样会报上述错误。 ......
  • 解决Spring Boot Configuration Annotation Processor not configured
    解决SpringBootConfigurationAnnotationProcessornotconfigured问题背景进行SpringBoot配置文件部署时,发出警告,该爆红不影响使用,但是爆红感觉很难受,点击OpenDocu......
  • springmvc的简单使用(3)
    一:日期处理:1:日期的提交处理: 单个日期处理:要使用注解,并且注解要搭配springmvc文件中的<annotationdriven><mvc:annotation-driven></mvc:annotation-driven><formact......
  • 【Spring5学习笔记(3)】JdbcTemplate操作数据库:
    JdbcTemplate(概念和准备)1、什么是JdbcTempate(1)Spring框架对JDBC进行封装,使用JdbcTemplate方便实现对数据库操作2、准备工作(1)引入相关依赖(2)在spring配置文件配......
  • SpringSecurity 新版2.7以上 快速入门
    SpringSecurity快速入门1、导入依赖<dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-security</artifactId></de......
  • [Spring框架]IOC容器
    一、IOC容器1.什么是IOC?把对象创建和对象之间的调用过程,交给Spring进行管理使用目的:降低耦合度2.IOC底层?xml解析工厂模式反射IOC是一个容器,本质上就是一个对......