Set OGNL (Object-Graph Navigation Language ) true in struts.xml file
struts.xml
<constant name="struts.ognl.allowStaticMethodAccess" value="true" />
Enum
package com.raj.controller.pkg;
public enum PkgStatusConstants {
ACTIVE("Active"),
INACTIVE("Inactive");
public final String val;
PkgStatusConstants(String val){
this.val = val;
}
}
Select Tag in Jsp
<s:select name="pkgData.status" key="getText('pkg.status')" list="@com.raj.controller.pkg.PkgStatusConstants@values()" cssClass="form-control" />
Keep Visiting
Write your Comment
Save my life....
ReplyDeleteThanks for your comment
ReplyDelete