springboot访问html文件
1 在pom.xml加入
2 在resources\templates\hello.html
3 在Controller中加入
@RequestMapping("/hello")
public String helloHtml(HashMap map){
map.put("hello","HelloWord"); return"/hello";
}
启动,然后输入localhost:8080/hello
会跳转到页面
注意:必须加入thymeleaf包,不然找不到