I have an Enum called Status defined as such:
public enum Status {
VALID("valid"), OLD("old");
private final String val;
Status(String val) {
this.val = val;
}
public String getStatus() {
return val;
}
}
I would like to access the value of VALID
from a JSTL tag. Specifically the test
attribute of the <c:when>
tag. E.g.
<c:when test="${dp.status eq Status.VALID">
I'm not sure if this is possible.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…