I have two submit buttons in my JSP add, remove. I do not know how to distinguish operations on the controller side.
<form:form modelAttribute="emp" action="/empl" method="POST">
<input type="submit" name="operation" value="Remove"/>
<input type="submit" name="operation" value="Add" />
</form:form>
@RequestMapping(value = "/empl", method = RequestMethod.POST)
public String getD(@Valid Em form, BindingResult result, Model model) {
At any time, click the "+" button, or the "Delete operation", respectively, and then add work, because this is the default method called. Now, how can I grasp the operation parameter and differentiate the operation and use it?
source
share