This forum is now a read-only archive. All commenting, posting, registration services have been turned off. Those needing community support and/or wanting to ask questions should refer to the Tag/Forum map, and to http://spring.io/questions for a curated list of stackoverflow tags that Pivotal engineers, and the community, monitor.

Although we use Struts tag libraries I believe the approach would be valid for Spring Tags too.

It is however a good candidate for an extension to the framework itself.

P.S. For binding you must provide a custom java.beans.PropertyEditor implementation (extends PropertyEditorSupport and override setAsText() and getAsText()) and register it.
Check the o.s.w.bind.support.WebBindingInitializer and o.s.w.bind.support.ConfigurableWebBindingInitializ er.

Comment

I registered a custom property editor with the controller managing the form. To populate the options, I had to write a method to return an array of String representations of the enum. It's an imperfect solution but probably easier than extending the tag.

Comment

Providing a converter (kind of like a PropertyEditor) is how I did it in Spring WebFlow. However, this uses the Enum name as the <option> value. I am yet to figure out how to support I18N in case the Enum name needs to be localized for different locale. Any good idea on I18N with Enum binding?