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

org.apache.tiles.jsp.taglib
Class RenderTag

Package class diagram package RenderTag
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.RenderTag
All Implemented Interfaces:
Serializable, BodyTag, IterationTag, JspTag, Tag, TryCatchFinally, PutAttributeTagParent, PutListAttributeTagParent
Direct Known Subclasses:
InsertAttributeTag, InsertTemplateTag, RenderTagSupport

public abstract class RenderTag
extends TilesBodyTag
implements PutAttributeTagParent, PutListAttributeTagParent

Abstracts class for all tags which render (an attribute, 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:
2.1.1
Version:
$Rev: 749983 $ $Date: 2009-03-04 13:41:31 +0100 (mer, 04 mar 2009) $
See Also:
Serialized Form

Field Summary
protected  AttributeContext attributeContext
          The attribute context to use to store and read attribute values.
protected  TilesContainer container
          The Tiles container that can be used inside the tag.
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.
protected  String role
          The role to check.
 
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
RenderTag()
           
 
Method Summary
 int doEndTag()
          
 int doStartTag()
          
protected  void endContext(PageContext context)
          Ends the context when exiting the tag.
 String getPreparer()
          Returns the preparer name.
 String getRole()
          Returns the role to check.
 boolean isFlush()
          Returns the flush flag.
 boolean isIgnore()
          Returns the ignore flag.
 void processNestedTag(PutAttributeTag nestedTag)
           Process nested ≶put> tag.
 void processNestedTag(PutListAttributeTag nestedTag)
          Process the nested 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.
 void setRole(String role)
          Sets the role to check.
protected  void startContext(PageContext context)
          Starts the context when entering the tag.
 
Methods inherited from class org.apache.tiles.jsp.taglib.TilesBodyTag
doCatch, doFinally, release
 
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

role

protected String role
The role to check. If the user is in the specified role, the tag is taken into account; otherwise, the tag is ignored (skipped).

Since:
2.1.1

preparer

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

Since:
2.1.1

flush

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

Since:
2.1.1

ignore

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

Since:
2.1.1

container

protected TilesContainer container
The Tiles container that can be used inside the tag.

Since:
2.1.1

attributeContext

protected AttributeContext attributeContext
The attribute context to use to store and read attribute values.

Since:
2.1.1
Constructor Detail

RenderTag

public RenderTag()
Method Detail

getRole

public String getRole()
Returns the role to check. If the user is in the specified role, the tag is taken into account; otherwise, the tag is ignored (skipped).

Returns:
The role to check.
Since:
2.1.1

setRole

public void setRole(String role)
Sets the role to check. If the user is in the specified role, the tag is taken into account; otherwise, the tag is ignored (skipped).

Parameters:
role - The role to check.
Since:
2.1.1

getPreparer

public String getPreparer()
Returns the preparer name.

Returns:
The preparer name.
Since:
2.1.1

setPreparer

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

Parameters:
preparer - The preparer name.
Since:
2.1.1

isFlush

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

Returns:
The flush flag.
Since:
2.1.1

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.
Since:
2.1.1

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.
Since:
2.1.1

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.
Since:
2.1.1

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 TilesBodyTag

doStartTag

public int doStartTag()
               throws TilesJspException

Specified by:
doStartTag in interface Tag
Overrides:
doStartTag in class BodyTagSupport
Throws:
TilesJspException

doEndTag

public int doEndTag()
             throws TilesJspException

Specified by:
doEndTag in interface Tag
Overrides:
doEndTag in class BodyTagSupport
Throws:
TilesJspException

render

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

Throws:
TilesJspException - if a jsp exception occurs.
IOException - if an io exception occurs.

startContext

protected void startContext(PageContext context)
Starts the context when entering the tag.

Parameters:
context - The page context to use.

endContext

protected void endContext(PageContext context)
Ends the context when exiting the tag.

Parameters:
context - The page context to use.

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. Security will be managed by called tags.

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

processNestedTag

public void processNestedTag(PutListAttributeTag nestedTag)
Process the nested tag.

Specified by:
processNestedTag in interface PutListAttributeTagParent
Parameters:
nestedTag - Nested tag to process.


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