1

I am trying access Enum options from jstl:

<select name="user_role">
    <spring:eval expression="UserRole.Role.values()" var="_enum"/>
    <c:forEach items="${_enum}" var="role">

        <option value="${role}">${role}</option>

    </c:forEach>

</select>

I see empty selector at run-time and my IDE warning me that Namespace 'spring' is not bound on my jsp.

Question: Is it possible to access enum from jstl? How to fix my code?

Rudziankoŭ
  • 10,681
  • 20
  • 92
  • 192

0 Answers0