I don't know if this is useful, but here it is:
If you do not set 'commandName' on the form, the default value for this property will be set to 'command'. So, if you do not install it, the associated data will have the name "command".
If you want, you can set it with the name of the associated data.
==================================================== ==========================
A solution without using data binding would be:
I would add the HttpServletRequest request parameter to the controller method and get a parameter similar to servlets.
@Controller public class SomeController { @RequestMapping(value = "/formAction", method = RequestMethod.POST) public String controllerMethod(HttpServletRequest request){
PS: "path1" and "path2" are the names of the paths that you set on the inputs. I know that it doesn't seem to use Spring correctly, but it is a hack that Spring allows us to use.
The form will be this way:
<form:form method="post" action="/formAction"> <form:input path="path1" /> <form:input path="path2" /> <input type="submit" value="Submit"/> </form:form>
Hope this is helpful.
source share