sts中thymeleaf中显示不出来
我在sts中使用thymeleaf页面起不了作用呢
application中的配置
spring.thymeleaf.prefix=classpath:/templates/
spring.thymeleaf.suffix=.html
spring.thymeleaf.mode=HTML5
spring.thymeleaf.encoding=UTF-8
spring.thymeleaf.content-type=text/html
spring.thymeleaf.cache=false
html页面
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8"/>
<title>Insert title here</title>
</head>
<body>
<h1 th:text="${hello}">Hello</h1>
</body>
</html>
控制器
@Controller
@EnableAutoConfiguration
public class StudentController {
@RequestMapping("/f")
public String free() {
Map<String,Object> map = new HashMap<String, Object>();
map.put("hello","user1");
return "freemarker/index";
}
}
}
页面显示不了user1
欢迎小伙伴速速解答