TagWriter can write empty attribute
See gh-910
This commit is contained in:
committed by
Rossen Stoyanchev
parent
3f7dec0b0d
commit
913cc079af
@@ -97,6 +97,19 @@ public class TagWriter {
|
||||
this.writer.append(" ").append(attributeName).append("=\"")
|
||||
.append(attributeValue).append("\"");
|
||||
}
|
||||
|
||||
/**
|
||||
* Write an empty HTML attribute with the specified name.
|
||||
* <p>Be sure to write all attributes <strong>before</strong> writing
|
||||
* any inner text or nested tags.
|
||||
* @throws IllegalStateException if the opening tag is closed
|
||||
*/
|
||||
public void writeAttribute(String attributeName) throws JspException {
|
||||
if (currentState().isBlockTag()) {
|
||||
throw new IllegalStateException("Cannot write attributes after opening tag is closed.");
|
||||
}
|
||||
this.writer.append(" ").append(attributeName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Write an HTML attribute if the supplied value is not {@code null}
|
||||
|
||||
Reference in New Issue
Block a user