我有一个类似下面的枚举:
public enum ElectionEventStatus {
NEW("enum.electioneventstatus.new"),
POLLING_NOMINATIONS("enum.electioneventstatus.pollingnominations"),
POLLED_NOMINATIONS("enum.electioneventstatus.pollednominations"),
POLLING_VOTES("enum.electioneventstatus.pollingvotes"),
POLLED_VOTES("enum.electioneventstatus.polledvotes"),
COMPLETED("enum.electioneventstatus.completed"),
INVALIDATED("enum.electioneventstatus.invalidated"),
;
public static final EnumSet<ElectionEventStatus> closedStatuses = EnumSet.of(POLLED_VOTES, COMPLETED);
private final String messageKey;
private ElectionEventStatus(String messageKey) {
this.messageKey = messageKey;
}
public String getMessageKey() {
return messageKey;
}
}
如何在jsp中引用closedStatus Enumset?我在struts.xml中启用了静态访问
<constant name="struts.ognl.allowStaticMethodAccess" value="true"/>
并试图像这样访问EnumSet但它没有用(我已经验证了包名是正确的)。感谢。
<s:if test="%{electionEventStatus in @net.tangs.business.electionevent.constants.ElectionEventStatus@closedStatuses}">