I have a list containing users. I am trying to print it in JSP but some how I am not able to get it to print it using spring:bind. I get an exception. The reason I am trying to use spring:bind is to invole @Formatting annotation.
Code in JSP
<c:forEach items="${users}" var="user" varStatus="status">
<spring:bind path="users[${status.index}].name">
<c:out value="${status.value}" />
</spring:bind>
</c:forEach>
Controller
ModelAndView modelAndView = new ModelAndView("go_some_JSP_page");
List<UserEntity> users = userManager.getAllObjects();
modelAndView.addObject("users", users);
BTW, UserEntity has name field. If I remove the binding and try to print the user.name using <c:out value="user.name" /> it prints the value
A test sample code exists at https://github.com/hth/StatusInvoke.git
Please take a look at landing.jsp line 35
Let me know if you face any problem deploying it.
The correct answer to invoke @NumberFormat annotation is by using
spring:eval expressiontag