<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
a.html内容如下:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<h1>AAaaAA</h1>
</body>
</html>
b.html文件内容如下:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<h1>BBbbBB</h1>
</body>
</html>
package com.sic.equipment.controller;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
@EnableAutoConfiguration
@RequestMapping("/a")
public class TestController {
@RequestMapping("/2")
public String aa(){
return "a";
}
@RequestMapping("/3")
public String ab(){
return "qiu/b";
}
}
SpringBoot跳转到静态html页面&&静态文件放置位置
原文:https://blog.51cto.com/doublelinux/2437039