我有没有动作定义的形式。字段的属性与模型相关联。我的问题是 - 春天怎么知道的映射是没有什么定义的动作。我敢肯定,它只是春天魔术,而是想知道它背后的细节。
JSP代码:
<form:form method="post" modelAttribute="user">
</form:form>
控制器代码:
@RequestMapping(value = "/bank-admin-actions", method = RequestMethod.GET)
春MVC注释@RequestMapping能够处理HTTP请求的方法,如GET,PUT,POST和DELETE。正是在这样的文档Documentation解释。
@RequestMapping("/api1")
@ResponseBody
public String abc() {
return "example1";
}
@RequestMapping(value="/ap1", method = RequestMethod.GET)
@ResponseBody
public String abc2() {
return "example2";
}
现在,这里如果你做一个GET请求假设“http://localhost/ap1”使用任何工具(邮差为例)的反应将是“例题”。所有其他支持的HTTP方法(POST,PUT,DELETE)会导致实例1中,你可以参考这个Answer,我只是转述这个答案。