标签:cti type charset org obj ref char 结果 localhost
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
spring.thymeleaf.cache=false
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import java.util.Map;
@Controller
@RequestMapping("/home")
public class HomeController {
@RequestMapping(value = "/index")
public String index(Map<String,Object> map) {
map.put("userName","Bill Gates");
return "index";
}
}
/resources/templates/index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8"></meta>
<title>Title</title>
</head>
<body>
<h1>hello,<span th:text="${userName}"></span></h1>
</body>
</html>
访问地址:http://localhost:8090/home/index
标签:cti type charset org obj ref char 结果 localhost
原文地址:https://www.cnblogs.com/bqh10086/p/11108266.html