Wednesday, May 05, 2010

<form:label/> in Spring should have MessageSource support

If you have used any version of Spring upto 3.0 you would be surprised when using form:label tag:-

<form:label path="foo.bar"/>  
does not render anything in HTML. You would not see the data in foo.bar in the resultant HTML. In fact the html equivalent would be <label for="foo.bar"></label>

For the text to show in your view use <form:label path="foo.bar">The actual label</form:label>
eg. <form:label path="foo.bar">${command.foo.bar}</form:label>

There is already a Spring JIRA issue for the MessageSource support: http://jira.springframework.org/browse/SPR-2566

No comments:

Post a Comment

Thank you for your feedback