java - What is the advantage of form:label tag in Spring? -


<form:label path="company">enter company name:</form:label> 

renders -

<label for="company">enter company name:</label> 

why shouldn't directly use html tag more concise?

the <form:label /> tag has access underlying model , binding results , such can, on error, use style class.

<form:label cssclass="title" csserrorclass="title error" path="company" /> 

the code above would, in case of error, render differently normal case. of course without form tag mean need include logic pages, in general isn't advised.

for properties see reference guide


Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -