|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.web.servlet.tags.form.TagWriter
public class TagWriter
Utility class for writing HTML content to a Writer
instance.
Intended to support output from JSP tag libraries.
Constructor Summary | |
---|---|
TagWriter(PageContext pageContext)
Create a new instance of the TagWriter class that writes to
the supplied PageContext . |
|
TagWriter(Writer writer)
Create a new instance of the TagWriter class that writes to
the supplied Writer . |
Method Summary | |
---|---|
void |
appendValue(String value)
Close the current opening tag (if necessary) and appends the supplied value as inner text. |
void |
endTag()
Close the current tag. |
void |
endTag(boolean enforceClosingTag)
Close the current tag, allowing to enforce a full closing tag. |
void |
forceBlock()
Indicate that the currently open tag should be closed and marked as a block level element. |
void |
startTag(String tagName)
Start a new tag with the supplied name. |
void |
writeAttribute(String attributeName,
String attributeValue)
Write an HTML attribute with the specified name and value. |
void |
writeOptionalAttributeValue(String attributeName,
String attributeValue)
Write an HTML attribute if the supplied value is not null
or zero length. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TagWriter(PageContext pageContext)
TagWriter
class that writes to
the supplied PageContext
.
pageContext
- the JSP PageContext to obtain the Writer
frompublic TagWriter(Writer writer)
TagWriter
class that writes to
the supplied Writer
.
writer
- the Writer
to write tag content toMethod Detail |
---|
public void startTag(String tagName) throws JspException
JspException
endTag()
public void writeAttribute(String attributeName, String attributeValue) throws JspException
Be sure to write all attributes before writing any inner text or nested tags.
IllegalStateException
- if the opening tag is closed
JspException
public void writeOptionalAttributeValue(String attributeName, String attributeValue) throws JspException
null
or zero length.
JspException
writeAttribute(String, String)
public void appendValue(String value) throws JspException
IllegalStateException
- if no tag is open
JspException
public void forceBlock() throws JspException
Useful when you plan to write additional content in the body
outside the context of the current TagWriter
.
JspException
public void endTag() throws JspException
Correctly writes an empty tag if no inner text or nested tags have been written.
JspException
public void endTag(boolean enforceClosingTag) throws JspException
Correctly writes an empty tag if no inner text or nested tags have been written.
enforceClosingTag
- whether a full closing tag should be
rendered in any case, even in case of a non-block tag
JspException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |