com.interface21.web.servlet.tags
Class RequestContextAwareTag

java.lang.Object
  |
  +--javax.servlet.jsp.tagext.TagSupport
        |
        +--com.interface21.web.servlet.tags.RequestContextAwareTag
All Implemented Interfaces:
javax.servlet.jsp.tagext.IterationTag, java.io.Serializable, javax.servlet.jsp.tagext.Tag
Direct Known Subclasses:
BindErrorsTag, BindTag, MessageTag

public abstract class RequestContextAwareTag
extends javax.servlet.jsp.tagext.TagSupport

Superclass for all tags that require a RequestContext. The RequestContext instance provides easy access to current state like WebApplicationContext, Locale, Theme, etc.

Supports a HTML escaping setting per tag instance, overriding any default setting at the page or web.xml level.

Note: Works only in DispatcherServlet requests!

Author:
Rod Johnson, Juergen Hoeller
See Also:
RequestContext, HtmlEscapeTag.setDefaultHtmlEscape(boolean), HtmlEscapeTag.HTML_ESCAPE_CONTEXT_PARAM, Serialized Form

Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
 
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
RequestContextAwareTag()
           
 
Method Summary
 int doStartTag()
          Create and set the current RequestContext.
protected  RequestContext getRequestContext()
          Return the current RequestContext.
protected  boolean isHtmlEscape()
          Return the HTML escaping setting for this tag, or the default setting if not overridden.
 void setHtmlEscape(boolean htmlEscape)
          Set HTML escaping for this tag, overriding the default HTML escaping setting for the current page.
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, doEndTag, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RequestContextAwareTag

public RequestContextAwareTag()
Method Detail

setHtmlEscape

public final void setHtmlEscape(boolean htmlEscape)
Set HTML escaping for this tag, overriding the default HTML escaping setting for the current page.
See Also:
HtmlEscapeTag.setDefaultHtmlEscape(boolean)

isHtmlEscape

protected final boolean isHtmlEscape()
Return the HTML escaping setting for this tag, or the default setting if not overridden.
Returns:
 

getRequestContext

protected final RequestContext getRequestContext()
Return the current RequestContext.

doStartTag

public int doStartTag()
               throws javax.servlet.jsp.JspException
Create and set the current RequestContext. Note: Do not forget to call super.doStartTag() in subclasses!
Overrides:
doStartTag in class javax.servlet.jsp.tagext.TagSupport


Rod Johnson and Spring contributors 2001-2003.