You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SPR-3389 Nicer handling of Java 5 enums by the Spring MVC form taglib.
The form:options and form:radiobuttons tags will now render a set of options automatically if the bind target is an Enum and items are not otherwise specified. The values of the enum are converted into form inputs where by default the form value is the enum's name() and the form label is the enum's toString().
Copy file name to clipboardexpand all lines: org.springframework.web.servlet/src/main/java/org/springframework/web/servlet/tags/form/AbstractMultiCheckedElementTag.java
+16-1
Original file line number
Diff line number
Diff line change
@@ -35,6 +35,7 @@
35
35
* of '<code>checkbox</code>' or '<code>radio</code>'.
Copy file name to clipboardexpand all lines: org.springframework.web.servlet/src/main/resources/META-INF/spring-form.tld
+4-4
Original file line number
Diff line number
Diff line change
@@ -971,9 +971,9 @@
971
971
</attribute>
972
972
<attribute>
973
973
<name>items</name>
974
-
<required>true</required>
974
+
<required>false</required>
975
975
<rtexprvalue>true</rtexprvalue>
976
-
<description>The Collection, Map or array of objects used to generate the inner 'option' tags</description>
976
+
<description>The Collection, Map or array of objects used to generate the inner 'option' tags. This attribute is required unless the containing select's property for data binding is an Enum, in which case the enum's values are used.</description>
977
977
</attribute>
978
978
<attribute>
979
979
<name>itemValue</name>
@@ -1433,9 +1433,9 @@
1433
1433
<!-- radiobuttons specific attributes -->
1434
1434
<attribute>
1435
1435
<name>items</name>
1436
-
<required>true</required>
1436
+
<required>false</required>
1437
1437
<rtexprvalue>true</rtexprvalue>
1438
-
<description>The Collection, Map or array of objects used to generate the 'input' tags with type 'radio'</description>
1438
+
<description>The Collection, Map or array of objects used to generate the 'input' tags with type 'radio'. This attribute is required unless the property for data binding is an Enum, in which case the enum's values are used.</description>
Copy file name to clipboardexpand all lines: org.springframework.web.servlet/src/test/java/org/springframework/web/servlet/tags/form/OptionsTagTests.java
Copy file name to clipboardexpand all lines: org.springframework.web.servlet/src/test/java/org/springframework/web/servlet/tags/form/RadioButtonsTagTests.java
0 commit comments