SpringBoot 结合Thymeleaf 进⾏页⾯的跳转
1、引⼊thymeleaf依赖
2、在l 进⾏thymeleaf配置
3、编写Controller
⽂件结构:
访问localhost:8080  或者 localhost:8080/index
<!--thymeleaf-->
<dependency >
  <groupId >org.springframework.boot </groupId >
  <artifactId >spring-boot-starter-thymeleaf </artifactId > </dependency >
# 配置页⾯地址
spring:
  thymeleaf:
  prefix: classpath:/templates/
// 服务启动⾃动跳转⾸页
@RequestMapping(value = {"/","index"})
public  String index(){springboot结构
  return  "index";
}

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。