Two submits in one JPS and two actions in Spring -
i know question has been asked , answered don`t seems have found solution.
<form:form method="post" action="my.htm" modelattribute="someform"> <div class="rightalign"><input type="submit" value="something" name="something"/></div> <div class="rightalign"><input type="submit" value="delete" name="delete"/></div> </form:form>
how should map in controller?
@requestmapping(method = requestmethod.post, params="/delete")
or
@requestmapping(method = requestmethod.post, value="/something")
form's action
corresponds requestmapping's value
parameter, name
of input field used name of http parameter, use params
element "catch" it. correct requestmapping configuration filter form's content be:
@requestmapping(value="my.htm", method=requestmethod.post, params="delete")
and
@requestmapping(value="my.htm", method=requestmethod.post, params="something")
(it's in documentation)
Comments
Post a Comment