Add newline at the beginning of textarea JSP tags
This commit adds a newline char at the beginning of textarea tags values. As per the HTML 4.01 spec (and browsers behavior), a line break following a start tag is ignored. This can lead to Spring's textarea tag to ignore a line break char at the beginning of a tag value. See https://www.w3.org/TR/html401/appendix/notes.html#notes-line-breaks Issue: SPR-13503
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2015 the original author or authors.
|
||||
* Copyright 2002-2016 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -121,6 +121,16 @@ public class TextareaTagTests extends AbstractFormTagTests {
|
||||
assertBlockTagContains(output, "12.34f");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void firstNewLine() throws Exception {
|
||||
this.tag.setPath("name");
|
||||
this.tag.setReadonly(true);
|
||||
|
||||
assertEquals(Tag.SKIP_BODY, this.tag.doStartTag());
|
||||
String output = getOutput();
|
||||
assertBlockTagContains(output, "\r\nRob");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected TestBean createTestBean() {
|
||||
// set up test data
|
||||
|
||||
Reference in New Issue
Block a user