This project has retired. For details please refer to its Attic page.
RenderTagSupport (Tiles 2 2.0.7 API)

org.apache.tiles.jsp.taglib
Class RenderTagSupport

Package class diagram package RenderTagSupport
java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by javax.servlet.jsp.tagext.BodyTagSupport
          extended by org.apache.tiles.jsp.taglib.TilesBodyTag
              extended by org.apache.tiles.jsp.taglib.RoleSecurityTagSupport
                  extended by org.apache.tiles.jsp.taglib.ContainerTagSupport
                      extended by org.apache.tiles.jsp.taglib.RenderTagSupport
All Implemented Interfaces:
Serializable, BodyTag, IterationTag, JspTag, Tag, TryCatchFinally, PutAttributeTagParent
Direct Known Subclasses:
InsertAttributeTag, InsertDefinitionTag, InsertTemplateTag

public abstract class RenderTagSupport
extends ContainerTagSupport
implements PutAttributeTagParent

Support for all tags which render (a template, or definition).

Properly invokes the defined preparer and invokes the abstract render method upon completion.

This tag takes special care to ensure that the attribute context is reset to it's original state after the execution of the tag is complete. This ensures that all all included attributes in subsequent tiles are scoped properly and do not bleed outside their intended scope.

Since:
Tiles 2.0
Version:
$Rev: 727715 $ $Date: 2008-12-18 14:06:06 +0100 (Thu, 18 Dec 2008) $
See Also:
Serialized Form

Field Summary
protected  boolean flush
          This flag, if true, flushes the content before rendering.
protected  boolean ignore
          This flag, if true, ignores exception thrown by preparers and those caused by problems with definitions.
protected  String preparer
          The view preparer to use before the rendering.
 
Fields inherited from class org.apache.tiles.jsp.taglib.ContainerTagSupport
attributeContext, container
 
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
RenderTagSupport()
           
 
Method Summary
 int doStartTag()
          By default, all ContainerTags evaluate their body.
protected  void execute()
          Execute the tag by invoking the preparer, if defined, and then rendering.
 String getPreparer()
          Returns the preparer name.
 boolean isFlush()
          Returns the flush flag.
 boolean isIgnore()
          Returns the ignore flag.
 void processNestedTag(PutAttributeTag nestedTag)
           Process nested ≶put> tag.
protected abstract  void render()
          Render the specified content.
protected  void reset()
          Release any per-invocation resources, resetting any resources or state that should be cleared between successive invocations of Tag.doEndTag() and Tag.doStartTag().
 void setFlush(boolean flush)
          Sets the flush flag.
 void setIgnore(boolean ignore)
          Sets the ignore flag.
 void setPreparer(String preparer)
          Sets the preparer name.
 
Methods inherited from class org.apache.tiles.jsp.taglib.ContainerTagSupport
doEndTag, endContext, release, startContext
 
Methods inherited from class org.apache.tiles.jsp.taglib.RoleSecurityTagSupport
getRole, isAccessAllowed, setRole
 
Methods inherited from class org.apache.tiles.jsp.taglib.TilesBodyTag
doCatch, doFinally
 
Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport
doAfterBody, doInitBody, getBodyContent, getPreviousOut, 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
 

Field Detail

preparer

protected String preparer
The view preparer to use before the rendering.


flush

protected boolean flush
This flag, if true, flushes the content before rendering.


ignore

protected boolean ignore
This flag, if true, ignores exception thrown by preparers and those caused by problems with definitions.

Constructor Detail

RenderTagSupport

public RenderTagSupport()
Method Detail

getPreparer

public String getPreparer()
Returns the preparer name.

Returns:
The preparer name.

setPreparer

public void setPreparer(String preparer)
Sets the preparer name.

Parameters:
preparer - The preparer name.

isFlush

public boolean isFlush()
Returns the flush flag. If true, current page out stream is flushed before insertion.

Returns:
The flush flag.

setFlush

public void setFlush(boolean flush)
Sets the flush flag. If true, current page out stream is flushed before insertion.

Parameters:
flush - The flush flag.

isIgnore

public boolean isIgnore()
Returns the ignore flag. If it is set to true, and the attribute specified by the name does not exist, simply return without writing anything. The default value is false, which will cause a runtime exception to be thrown.

Returns:
The ignore flag.

setIgnore

public void setIgnore(boolean ignore)
Sets the ignore flag. If this attribute is set to true, and the attribute specified by the name does not exist, simply return without writing anything. The default value is false, which will cause a runtime exception to be thrown.

Parameters:
ignore - The ignore flag.

reset

protected void reset()
Release any per-invocation resources, resetting any resources or state that should be cleared between successive invocations of Tag.doEndTag() and Tag.doStartTag().

Overrides:
reset in class RoleSecurityTagSupport

doStartTag

public int doStartTag()
               throws JspException
By default, all ContainerTags evaluate their body. Subclasses may choose to be more selective. In any case, children can rely upon the container and attributeContext being initialized if they call super.doStartTag()

Specified by:
doStartTag in interface Tag
Overrides:
doStartTag in class ContainerTagSupport
Returns:
EVAL_BODY_BUFFERED.
Throws:
JspException - If the container has not been initialized.

execute

protected void execute()
                throws TilesException,
                       JspException,
                       IOException
Execute the tag by invoking the preparer, if defined, and then rendering.

Specified by:
execute in class RoleSecurityTagSupport
Throws:
TilesException - if a prepare or render exception occurs.
JspException - if a jsp exception occurs.
IOException - if an io exception occurs.

render

protected abstract void render()
                        throws JspException,
                               TilesException,
                               IOException
Render the specified content.

Throws:
TilesException - if a prepare or render exception occurs.
JspException - if a jsp exception occurs.
IOException - if an io exception occurs.

processNestedTag

public void processNestedTag(PutAttributeTag nestedTag)

Process nested ≶put> tag.

Places the value of the nested tag within the AttributeContext.It is the responsibility of the descendent to check security. Tags extending the ContainerTagSupport will automatically provide the appropriate security.

Specified by:
processNestedTag in interface PutAttributeTagParent
Parameters:
nestedTag - the put tag desciendent.


Copyright © 2001-2008 Apache Software Foundation. All Rights Reserved.