【发布时间】:2013-08-15 11:33:43
【问题描述】:
@ModelAttribute annotation(Spring) 允许 html 创建对象。
比如有一个类
class Vasya{
int id;
String name;
//set get
}
和html表单
<form action='path'>
<input type='text' name = 'id'/>
<input type='text' name = 'name'/>
<input type='submit'/>
</form>
@controller方法:
@RequestMapping("/path")
public String processSkill( @ModelAttribute Vasya vasya) {...}
在这里有效。
问题: 如何使用 *checkbox*es 为我的控制器方法工作的 id 和名称编写 html 表单?
【问题讨论】:
标签: java html spring jsp jakarta-ee