The below code is not working...
From the Spring Controller I am putting a list of strings into prefferedColumn
, which is then added to Model (Request Scope). Also, I have results as a list of Product objects
<c:forEach items="${demoForm.results}" var="product">
<c:forEach items="${prefferedColumn}" var="prefColunm">
<c:set var="field" value="\$\{product.${prefColunm.colIdentifier}\}" />
<td><c:out value="${field}" /></td>
</c:forEach>
</c:forEach>
But I think JSTL does not evaluate a dynamic expression.
c:out I have value null.
How can I evaluate a dynamic JSTL expression ?
Say in Product.java I have almost 80 properties with a getter and a setter, but this logged in user wants only 8 products to be displayed on the list page, in which the 8 property names are stored in the prefferedColumn list.