日期:2014-05-19 浏览次数:20736 次
<form:form action="/student/addStudent" modelAttribute="student" method="post">
<table>
<tr>
<td><form:label path="name">Name</form:label></td>
<td><form:input path="name" /></td>
</tr>
<tr>
<td><form:label path="age">Age</form:label></td>
<td><form:input path="age" /></td>
</tr>
<tr>
<td><form:label path="id">id</form:label></td>
<td><form:input path="id" /></td>
</tr>
<tr>
<td colspan="2"><input type="submit" value="Submit" />
</td>
</tr>
</table>
</form:form>
@Controller
@RequestMapping("/student")
public class StudentController {
@RequestMapping(value = "/addStudent",method = RequestMethod.POST)
public String addStudent(@ModelAttribute("student") Student student,BindingResult result) {
// model.addAttribute("student", student);
System.out.println("addStudent");
return "test";
}
}