posted 12 years ago
I have two beans in request context bean1 and bean2 (say).
One of the properties of bean1 is prop1 with value val1. Business logic ensures that bean2 is going to have a property named val1 with value val2.
Objective is to display the value val2 on the page.
Can someone help me with suitable jstl code?
<c:out value="S{bean1.prop1}" /> works, prints val1
<c:out value="S{bean2.val1}" /> works, prints val2
But I need something generic like <c:out value="S{bean2.${bean1.prop1} }" />