I have an enum class USState
. I would like to iterate through the states in a JSP.
Is it possible to access a list of USState
s without first setting such a list as an attribute? It seems that something as static as an enum should always be available, but I can't figure out how to do it.
Here's what I'm looking for: (except working)
<c:forEach var="state" items="${USState.values}" >
<option value="${state}">${state}</option>
</c:forEach>