I am trying to dynamically generate content using JSP.
I have a <c:forEach>
loop within which I dynamically create bean accessors. The skeleton resembles this:
<c:forEach var="type" items="${bean.positionTypes}">
${bean.table} // append 'type' to the "table" property
</c:forEach>
My problem is: I want to change the ${bean.table}
based on the type. For example, if the types were {"Janitor", "Chef}
, I want to produce:
${bean.tableJanitor}
${bean.tableChef}
How can I achieve this?