我的jsp代码为:
<s:url value="add" var="addUrl"/>
<form:form name="add" action="${addUrl}" modelAttribute="content" method="post">
<input type="hidden" name="add" value="" />
<form:select path="id" class="dClass" onchange="submit()">
<form:options items="${list}" /></form:select>
<input type="submit" class="btn" value="Refresh Content" />
</form:form>
而且我对这两个调用都有一个控制器方法,有什么方法可以将其与提交表单的位置区分开来?从下拉菜单还是从提交按钮?
@RequestMapping(value = "/add", method = RequestMethod.POST)
public String getContentById(Model model, String id,Content content,HttpServletRequest request) {
if(call by onChange)
else if(call by submit button)
}