I am new to jsp and jstl technology. I am trying to print out a some text in <c:out value>
, please see point 1 in code. I am trying to display a text like this -
Account Manager-5
Here ${aStageRole.displayName} = 'Account Manager'
and (pro.stageRoles
) is an array which length is 5
.
<select id="selectRole<%=i %>" onchange="javascript:selectRole('selectRole<%=i %>')">
<c:forEach items="${pro.stageRoles}" var="aStageRole" varStatus="status">
<option value="${aStageRole.role.id}"> <c:out value="${aStageRole.displayName}-{fn:length(pro.stageRoles)}"/></option> //1
</c:forEach>
</select>
But the code outputs the following value in the dropdown -
Account Manager-{fn:length(pro.stageRoles)}
Can anyone help me how can I solve this problem?