Suppose you want to select the first element of a List to print it. Easy
It can get complicated if you have not a list but a map, with numeric keys - see here.<c:out value="${myList[0]}" />
What about comparing strings :
Comparing the above two for selecting an option in a drop down :<c:if test = "${user.role == 'ADMIN'}">
Notice this wont work with xhtml. See here for escaping quotes.<option value="${role}" ${role == selectedRole ? 'selected' : ''}>${role}</option>
TBC
Posted2013.04.15 13.23 UTC