Is there a way to use Enum values inside a JSP without using scriptlets.
e.g.
package com.example; public enum Direction { ASC, DESC }
so in the JSP I want to do something like this
<c:if test='${foo.direction ==<% com.example.Direction.ASC %>}'>...
You could implement the web-friendly text for a direction within the enum as a field:
but that mixes the view and the model, although for simple uses it can be view-independent (‘Ascending’, ‘Descending’, etc).
Unless you don’t like putting straight Java into your JSP pages, even when used for basic things like comparisons.