- Direct Known Subclasses:
OutTag
- Author:
- AO Industries, Inc.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddoTag()Deprecated.protected voidabstract MediaTypeGets the output type of this tag.protected voidinvoke(JspFragment body) Invokes the body.protected voidsetMediaEncoderOptions(MediaEncoder mediaEncoder) Sets the media encoder options.protected voidwriteEncoderPrefix(MediaEncoder mediaEncoder, Writer out) protected voidwriteEncoderSuffix(MediaEncoder mediaEncoder, Writer out, boolean trim) protected voidwritePrefix(MediaType containerType, Writer out) Writes any prefix in the container's media type.protected voidwriteSuffix(MediaType containerType, Writer out) Writes any suffix in the container's media type.Methods inherited from class jakarta.servlet.jsp.tagext.SimpleTagSupport
findAncestorWithClass, getJspBody, getJspContext, getParent, setJspBody, setJspContext, setParent
-
Constructor Details
-
EncodingNullTag
public EncodingNullTag()
-
-
Method Details
-
getOutputType
Gets the output type of this tag. This is used to determine the correct encoder. If the tag never has any output this should returnnull. Whennullis returned, any output will result in an error. -
doTag
Deprecated.You should probably be implementing indoTag(java.io.Writer)- Specified by:
doTagin interfaceSimpleTag- Overrides:
doTagin classSimpleTagSupport- Throws:
JspExceptionIOException- See Also:
-
invoke
Invokes the body. This is only called when a body exists. Subclasses may override this to perform actions before and/or after invoking the body. Any overriding implementation should callsuper.invoke(JspFragment)to invoke the body, unless it wants to suppress the body invocation.The
RequestEncodingContexthas been set toRequestEncodingContext.DISCARDbecause no validation of the content is necessary as the output is discarded. This means nested tags that attempt to produce valid output will not be limited by the parent encoding context of this tag.This implementation invokes
JspFragment.invoke(java.io.Writer)while discarding all nested output.- Throws:
JspExceptionIOException
-
writePrefix
Writes any prefix in the container's media type. The output must be valid for the provided type. This will not be called when the output type isnull.This default implementation prints nothing.
- Parameters:
out- Validates all characters against the container media type. Already optimized viaCoercion.optimize(java.io.Writer, com.aoapps.lang.io.Encoder).- Throws:
JspExceptionIOException- See Also:
-
setMediaEncoderOptions
Sets the media encoder options. This is how subclass tag attributes can effect the encoding. -
writeEncoderPrefix
protected void writeEncoderPrefix(MediaEncoder mediaEncoder, Writer out) throws JspException, IOException - Parameters:
out- Validates all characters against the container media type. Already optimized viaCoercion.optimize(java.io.Writer, com.aoapps.lang.io.Encoder).- Throws:
JspExceptionIOException
-
doTag
Once the outJspWriterhas been replaced to output the proper content type, this version ofdoTag()is called.The body, if present, has already been invoked with any output discarded.
This default implementation does nothing.
- Parameters:
out- When the output type isnull, will throw an exception if anything written, otherwise validates all characters against the output type. Already optimized viaCoercion.optimize(java.io.Writer, com.aoapps.lang.io.Encoder).- Throws:
JspExceptionIOException
-
writeEncoderSuffix
protected void writeEncoderSuffix(MediaEncoder mediaEncoder, Writer out, boolean trim) throws JspException, IOException - Parameters:
out- Validates all characters against the container media type. Already optimized viaCoercion.optimize(java.io.Writer, com.aoapps.lang.io.Encoder).- Throws:
JspExceptionIOException
-
writeSuffix
Writes any suffix in the container's media type. The output must be valid for the provided type. This will not be called when the output type isnull.This default implementation prints nothing.
- Parameters:
out- Validates all characters against the container media type. Already optimized viaCoercion.optimize(java.io.Writer, com.aoapps.lang.io.Encoder).- Throws:
JspExceptionIOException- See Also:
-

doTag(java.io.Writer)