springboot学习笔记

 

 thymeleaf使用:th:type  type为我们需要展示的信息的类型可以为text

<h3  th:each= "user:${user}"  th:text="${user}"></h3> 遍历并且输出为text 前一个user为
mode.addAttribute("user", Arrays.asList("guosai","lifei","huanglun")); 中的user 

后一个user为遍历出来的每一个user



@Controller
public class HelloController {

@GetMapping(value = "hello")
public String index( Model mode){
//mode.addAttribute("msg","hello,springboot");
mode.addAttribute("user", Arrays.asList("guosai","lifei","huanglun"));
return "test";//返回值就是最后跳转的页面
}
}
 

 

posted @ 2020-08-03 14:01  七月在野,八月在宇  阅读(127)  评论(0编辑  收藏  举报