<form:label path="company">Enter company name:</form:label>
Renders -
<label for="company">Enter company name:</label>
Why shouldn't I directly use the HTML tag which is more concise?
<form:label path="company">Enter company name:</form:label>
Renders -
<label for="company">Enter company name:</label>
Why shouldn't I directly use the HTML tag which is more concise?
The <form:label />
tag has access to the underlying model and binding results and as such can, on error, use another style class.
<form:label cssClass="title" cssErrorClass="title error" path="company" />
The code above would, in case of an error, render differently than the normal case. Of course you could also do this without the form tag but that would mean you need to include some logic into your pages, which in general isn't advised.
For all the properties see the reference guide
Not sure. However, it might help for Localization if the "Enter Company name:" was read from a message bundle source. Will check for more resources in the meantime
I really like using form:xxxx instead of the more traditional tags.
However, it seems to work best with PUT requests where I am modifying something, and maybe DELETE. With POST where everything is new, I tend to end up using the traditional tags.
It does link the human readable to the value being sent for automated readers, but both can do that.