Skip to content

Commit

Permalink
Remove closing tag in form tag's extra hidden fields
Browse files Browse the repository at this point in the history
The fields returned from a RequestDataValueProcessor are now
written as hidden fields without a closing tag.

Before:
<input type="hidden" name="xxx" value="yyy"></input>

After:
<input type="hidden" name="xxx" value="yyy" />

Issue: SPR-10103
  • Loading branch information
rstoyanchev committed Jan 8, 2013
1 parent 2ac4a8c commit c7d0054
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -469,8 +469,8 @@ private void writeHiddenFields(Map<String, String> hiddenFields) throws JspExcep
if (hiddenFields != null) {
for (String name : hiddenFields.keySet()) {
this.tagWriter.appendValue("<input type=\"hidden\" ");
this.tagWriter.appendValue("name=\"" + name + "\" value=\"" + hiddenFields.get(name) + "\">");
this.tagWriter.appendValue("</input>\n");
this.tagWriter.appendValue("name=\"" + name + "\" value=\"" + hiddenFields.get(name) + "\" ");
this.tagWriter.appendValue("/>\n");
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ public void testRequestDataValueProcessorHooks() throws Exception {

String output = getOutput();

assertEquals("<input type=\"hidden\" name=\"key\" value=\"value\"></input>", getInputTag(output));
assertEquals("<input type=\"hidden\" name=\"key\" value=\"value\" />", getInputTag(output));
assertFormTagOpened(output);
assertFormTagClosed(output);

Expand Down

0 comments on commit c7d0054

Please sign in to comment.