org.springframework.web.servlet.tags
Class RequestContextAwareTag

java.lang.Object
  extended by TagSupport
      extended by org.springframework.web.servlet.tags.RequestContextAwareTag
Direct Known Subclasses:
HtmlEscapeTag, HtmlEscapingAwareTag

public abstract class RequestContextAwareTag
extends TagSupport

Superclass for all tags that require a RequestContext.

The RequestContext instance provides easy access to current state like the WebApplicationContext, the Locale, the Theme, etc.

Mainly intended for DispatcherServlet requests; will use fallbacks when used outside DispatcherServlet.

Author:
Rod Johnson, Juergen Hoeller
See Also:
RequestContext, DispatcherServlet

Field Summary
protected  Log logger
          Logger available to subclasses
static java.lang.String REQUEST_CONTEXT_PAGE_ATTRIBUTE
          javax.servlet.jsp.PageContext attribute for the page-level RequestContext instance.
private  RequestContext requestContext
           
 
Constructor Summary
RequestContextAwareTag()
           
 
Method Summary
 void doCatch(java.lang.Throwable throwable)
           
 void doFinally()
           
 int doStartTag()
          Create and expose 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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REQUEST_CONTEXT_PAGE_ATTRIBUTE

public static final java.lang.String REQUEST_CONTEXT_PAGE_ATTRIBUTE
javax.servlet.jsp.PageContext attribute for the page-level RequestContext instance.

See Also:
Constant Field Values

logger

protected final Log logger
Logger available to subclasses


requestContext

private RequestContext requestContext
Constructor Detail

RequestContextAwareTag

public RequestContextAwareTag()
Method Detail

doStartTag

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

Throws:
JspException
See Also:
REQUEST_CONTEXT_PAGE_ATTRIBUTE, JspAwareRequestContext

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:
javax.servlet.jsp.tagext.TagSupport#doStartTag

doCatch

public void doCatch(java.lang.Throwable throwable)
             throws java.lang.Throwable
Throws:
java.lang.Throwable

doFinally

public void doFinally()