SelectTag consistently checks specified 'multiple' attribute now, never falling back to forceMultiple in case of user-provided value

Issue: SPR-11903
This commit is contained in:
Juergen Hoeller
2014-06-25 12:36:51 +02:00
parent b4e16eacc5
commit 779ca99f38
2 changed files with 113 additions and 6 deletions

View File

@@ -84,7 +84,7 @@ public class SelectTag extends AbstractHtmlInputElementTag {
* Indicates whether or not the '{@code select}' tag allows
* multiple-selections.
*/
private Object multiple = Boolean.FALSE;
private Object multiple;
/**
* The {@link TagWriter} instance that the output is being written.
@@ -249,9 +249,9 @@ public class SelectTag extends AbstractHtmlInputElementTag {
private boolean isMultiple() throws JspException {
Object multiple = getMultiple();
if (multiple != null && (Boolean.TRUE.equals(multiple) ||
Boolean.parseBoolean(multiple.toString()) || "multiple".equals(multiple))) {
return true;
if (multiple != null) {
String stringValue = multiple.toString();
return ("multiple".equalsIgnoreCase(stringValue) || Boolean.parseBoolean(stringValue));
}
return forceMultiple();
}