FreshmenProgrammer
Programmer
First I would like to say thanks in advance for whoever is helping. I really appreciate it.
I'm just wondering if you can compare the dept with a session scope bean variable. I know you can campare eg.${dept == 'accounting'} but I was wondering if you can campare the dept in the forEach loop with a Bean variable. Is that possible and how would you write it. Thank you!!.
I'm just wondering if you can compare the dept with a session scope bean variable. I know you can campare eg.${dept == 'accounting'} but I was wondering if you can campare the dept in the forEach loop with a Bean variable. Is that possible and how would you write it. Thank you!!.
Code:
<c:forEach var="dept" items="${sessionScope.dBean.dept}">
<c:choose>
<c:when test="${dept == sessionScope.Temp.dept}">
<option selected><c:out value="${dept}"/></option>
</c:when>
<c:otherwise>
<option><c:out value="${dept}"/></option>
</c:otherwise>
</c:choose>
</c:forEach>