Browse Source

Expose checkbox field marker as 'hidden' to RequestDataValueProcessor

Issue: SPR-17147

(cherry picked from commit fa72186e28)
pull/1935/head
Juergen Hoeller 8 years ago
parent
commit
bd060a19ac
  1. 4
      spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/CheckboxTag.java
  2. 4
      spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/CheckboxesTag.java

4
spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/CheckboxTag.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2012 the original author or authors. * Copyright 2002-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -57,7 +57,7 @@ public class CheckboxTag extends AbstractSingleCheckedElementTag {
tagWriter.writeAttribute("type", "hidden"); tagWriter.writeAttribute("type", "hidden");
String name = WebDataBinder.DEFAULT_FIELD_MARKER_PREFIX + getName(); String name = WebDataBinder.DEFAULT_FIELD_MARKER_PREFIX + getName();
tagWriter.writeAttribute("name", name); tagWriter.writeAttribute("name", name);
tagWriter.writeAttribute("value", processFieldValue(name, "on", getInputType())); tagWriter.writeAttribute("value", processFieldValue(name, "on", "hidden"));
tagWriter.endTag(); tagWriter.endTag();
} }

4
spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/CheckboxesTag.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2012 the original author or authors. * Copyright 2002-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -44,7 +44,7 @@ public class CheckboxesTag extends AbstractMultiCheckedElementTag {
tagWriter.writeAttribute("type", "hidden"); tagWriter.writeAttribute("type", "hidden");
String name = WebDataBinder.DEFAULT_FIELD_MARKER_PREFIX + getName(); String name = WebDataBinder.DEFAULT_FIELD_MARKER_PREFIX + getName();
tagWriter.writeAttribute("name", name); tagWriter.writeAttribute("name", name);
tagWriter.writeAttribute("value", processFieldValue(name, "on", getInputType())); tagWriter.writeAttribute("value", processFieldValue(name, "on", "hidden"));
tagWriter.endTag(); tagWriter.endTag();
} }

Loading…
Cancel
Save