Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use an enum in Struts html:select tag

Tags:

I am currently trying to create a html:select tag from an enum so it could be set in a specific object:

class someClass {
    SomeEnum someProperties = null;
    public getSomeProperties() { return someProperties; }
    public setSomeProperties(SomeEnum e) { someProperties = e; }

The JSP with Struts tags:

<html:select name="someForm" property="someInstance.someProperties" >
   <html:option value="${someEnum.STANDARD}"><bean:message key="i18nkeystd"/>
   <html:option value="${someEnum.PREVENTIVE} "><bean:message key="i18nkeyprev"/>
</html:select>

But I am currently getting a "Cannot invoke someClass.setProperties - argument type mismatch" exception.

Is there a way to use an enum in a Struts select tag.