In your second case, the spring:bind tag is out of date, your first form
<form:form method="post" action="http://localhost:8080/project/calculator/process" modelAttribute="keyPadForm"> Name1: <form:input type="text" path="name1" /> <form:errors path="name1" />
is a kind of syntactic sugar, and the equivalent without using the form tag library, and not just common HTML form tags, will be based on spring:bind and will look something like this:
<spring:nestedPath path="keyPadForm"> <form method="post" action="http://localhost:8080/project/calculator/process"> <spring:bind path="name1"> Name1:<input type="text" name="${status.expression}" value="${status.value}"> <span class="fieldError">${status.errorMessage}</span> </spring:bind> </form> </spring:nestedPath>
There are scenarios in which you can make a difference, for example. form:input always a two-way binding, so the value is sent to the server and the current value displayed, where, as in the case of spring:bind , you can achieve one-way binding, only send to the server, omitting the value, for example. <input type="text" name="${status.expression}"> but the main theme is that the form tag library provides more convenient tags related to binding
source share