1
我基于以下属性的用户表:Spring MVC的JSP select标签 - 对象列表GROUP BY
用户(ID,名字,姓氏,年龄)。
所有用户都按年龄分组,每个年龄段必须在选择标签中列出。
春控制器的方法:
@RequestMapping(value = "/listByAge")
public String listByAge(@ModelAttribute("user") User user, Model model){
model.addAttribute("ages", userService.groupByAge());
return "/listByAge";
}
JSP表单,选择标签:
<form:form action="/usersByAge/${age}" method="POST">
// The problem to list is here...
// I need to create a select tag
<button type="submit">List</button>
</form:form>
有人可以帮助解决这个问题?谢谢。
看看这个[回复](http://stackoverflow.com/a/24390678/1066779) – Rembo 2015-04-04 03:45:43