I have two submit buttons in thymeleaf template. I want it to submit it to 2 different actions in the same controller. I did the request mapping like this:
@RequestMapping(value="/directBind", params={"send"})
public String send(Model model, @ModelAttribute(value="directBind") DirectBind directBind){
@RequestMapping(value="/directBind", params={"addPolicy"})
public String addPolicy(final DirectBind directBind, Model model){
Two input buttons in html:
<input id="send" type="submit" value="send" name="send" class="btn btn-success finish" data-loading-text="Sent!"/>
<input type="submit" name="addPolicy" class="btn btn-default" style="margin-left: 1rem; margin-bottom: 1rem;"><span class="fa fa-plus"></span> </input>
Form :
<form enctype="multipart/form-data" class="ui form" th:object="${directBind}" th:action="@{/send}" method="post" style="padding:0 10px;">
Its submitting the form only to send action.