@RequestMapping(value="/list",method=RequestMethod.GET)
public String list(Model model) { //前台输出必须使用形如${ul.value.属性名 }的形式
model.addAttribute("userList",userList);
return "user/userList";
}
@RequestMapping(value="/userlist",method=RequestMethod.GET)
public String list(HttpServletRequest request) { //前台输出必须使用形如${user.id }的形式
List<User> userList = new ArrayList<User>();
userList.add(new User("1","yonghu1","121","1@qq.com"));
userList.add(new User("2","yonghu2","122","2@qq.com"));
userList.add(new User("3","yonghu3","123","3@qq.com"));
request.setAttribute("userList", userList);
return "user/userList";
}
添加回答
举报
0/150
提交
取消