org.owasp.esapi.tags
Class BaseEncodeTag

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by javax.servlet.jsp.tagext.BodyTagSupport
          extended by org.owasp.esapi.tags.BaseEncodeTag
All Implemented Interfaces:
java.io.Serializable, javax.servlet.jsp.tagext.BodyTag, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.Tag
Direct Known Subclasses:
EncodeForBase64Tag, EncodeForCSSTag, EncodeForHTMLAttributeTag, EncodeForHTMLTag, EncodeForJavaScriptTag, EncodeForURLTag, EncodeForVBScriptTag, EncodeForXMLAttributeTag, EncodeForXMLTag, EncodeForXPathTag

public abstract class BaseEncodeTag
extends javax.servlet.jsp.tagext.BodyTagSupport

Abstract base class for tags that just encode their bodies with Encoder methods.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.servlet.jsp.tagext.BodyTagSupport
bodyContent
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
 
Fields inherited from interface javax.servlet.jsp.tagext.BodyTag
EVAL_BODY_BUFFERED, EVAL_BODY_TAG
 
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
 
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
Constructor Summary
BaseEncodeTag()
           
 
Method Summary
 int doAfterBody()
          After tag body parsing handler.
protected abstract  java.lang.String encode(java.lang.String content, Encoder enc)
          Encode tag's content.
 
Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport
doEndTag, doInitBody, doStartTag, getBodyContent, getPreviousOut, release, setBodyContent
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.servlet.jsp.tagext.Tag
getParent, setPageContext, setParent
 

Constructor Detail

BaseEncodeTag

public BaseEncodeTag()
Method Detail

encode

protected abstract java.lang.String encode(java.lang.String content,
                                           Encoder enc)
                                    throws javax.servlet.jsp.JspTagException
Encode tag's content.

Parameters:
content - The tag's content as a String
enc - Encoder provided as a convinence.
Returns:
content encoded by the subclass's implementation.
Throws:
javax.servlet.jsp.JspTagException

doAfterBody

public int doAfterBody()
                throws javax.servlet.jsp.JspTagException
After tag body parsing handler. This provides the necessary plubming to allow subclasses to just concern themselves with encoding a single string.

Specified by:
doAfterBody in interface javax.servlet.jsp.tagext.IterationTag
Overrides:
doAfterBody in class javax.servlet.jsp.tagext.BodyTagSupport
Returns:
Tag.SKIP_BODY
Throws:
javax.servlet.jsp.JspTagException - if writing to the bodyContent's enclosing writer throws an IOException.


Copyright © 2011 The Open Web Application Security Project (OWASP). All Rights Reserved.