org.springframework.web.servlet.tags
Class RequestContextAwareTag

java.lang.Object
  extended byjavax.servlet.jsp.tagext.TagSupport
      extended byorg.springframework.web.servlet.tags.RequestContextAwareTag
All Implemented Interfaces:
javax.servlet.jsp.tagext.IterationTag, java.io.Serializable, javax.servlet.jsp.tagext.Tag, javax.servlet.jsp.tagext.TryCatchFinally
Direct Known Subclasses:
HtmlEscapeTag, HtmlEscapingAwareTag

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

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

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

Note: Only intended for DispatcherServlet requests!

Author:
Rod Johnson, Juergen Hoeller
See Also:
RequestContext, DispatcherServlet, HtmlEscapeTag.setDefaultHtmlEscape(java.lang.String), WebUtils.HTML_ESCAPE_CONTEXT_PARAM, Serialized Form

Field Summary
protected  org.apache.commons.logging.Log logger
           
protected static java.lang.String REQUEST_CONTEXT_PAGE_ATTRIBUTE
          PageContext attribute for page-level RequestContext instance
 
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
 void doCatch(java.lang.Throwable throwable)
           
 void doFinally()
           
 int doStartTag()
          Create and set the current RequestContext.
protected abstract  int doStartTagInternal()
          Called by doStartTag to perform the actual work.
protected  RequestContext getRequestContext()
          Return the current RequestContext.
 
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
 

Field Detail

REQUEST_CONTEXT_PAGE_ATTRIBUTE

protected static final java.lang.String REQUEST_CONTEXT_PAGE_ATTRIBUTE
PageContext attribute for page-level RequestContext instance

See Also:
Constant Field Values

logger

protected final org.apache.commons.logging.Log logger
Constructor Detail

RequestContextAwareTag

public RequestContextAwareTag()
Method Detail

doStartTag

public final int doStartTag()
                     throws javax.servlet.jsp.JspException
Create and set the current RequestContext. Delegates to doStartTagInternal for actual work.

Specified by:
doStartTag in interface javax.servlet.jsp.tagext.Tag
Throws:
javax.servlet.jsp.JspException
See Also:
doStartTagInternal()

getRequestContext

protected final RequestContext getRequestContext()
Return the current RequestContext.


doStartTagInternal

protected abstract int doStartTagInternal()
                                   throws java.lang.Exception
Called by doStartTag to perform the actual work.

Returns:
same as TagSupport.doStartTag
Throws:
java.lang.Exception - any exception, any checked one other than a JspException gets wrapped in a JspException by doStartTag
See Also:
TagSupport.doStartTag()

doCatch

public void doCatch(java.lang.Throwable throwable)
             throws java.lang.Throwable
Specified by:
doCatch in interface javax.servlet.jsp.tagext.TryCatchFinally
Throws:
java.lang.Throwable

doFinally

public void doFinally()
Specified by:
doFinally in interface javax.servlet.jsp.tagext.TryCatchFinally


Copyright (C) 2003-2004 The Spring Framework Project.