For an edit page, I have an enum. My code looks something like:
<s:selectItems value="#{myEnumTypes}"
var="enumType" label="#{messages[enumType]}"
hideNoSelectionLabel="true" noSelectionLabel="Please select..."/>
package com.mycompany.foo;
public enum enumType
{
E_ABC,
E_PQR,
E_XYZ;
@Override
public String toString ()
{
return name().substring(2);
}
}
I'd just like to add that I did have a build problem where the messages_en.properties file wasn't placed properly in WEB-INF/classes, but even after it was resolved, I still can't get the enum translations to work...