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

org.apache.tiles.jsp.taglib
Class AttributeTagSupport

Package class diagram package AttributeTagSupport
java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by org.apache.tiles.jsp.taglib.TilesTag
          extended by org.apache.tiles.jsp.taglib.AttributeTagSupport
All Implemented Interfaces:
Serializable, IterationTag, JspTag, Tag, TryCatchFinally
Direct Known Subclasses:
ImportAttributeTag, UseAttributeTag

public abstract class AttributeTagSupport
extends TilesTag

Support for Scoped tags.

Version:
$Rev: 795099 $ $Date: 2009-07-17 16:28:22 +0200 (ven, 17 lug 2009) $
See Also:
Serialized Form

Field Summary
protected  Attribute attribute
          The found attribute.
protected  AttributeContext attributeContext
          The current attribute context.
protected  Object attributeValue
          The attribute value.
protected  TilesContainer container
          The Tiles container to use.
protected  boolean ignore
          Flag that, if true, ignores exceptions.
protected  String name
          The name of the attribute.
protected  int scope
          The scope.
protected  String scopeName
          The scope name.
 
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
AttributeTagSupport()
           
 
Method Summary
 int doEndTag()
          
 int doStartTag()
          
abstract  void execute()
          Execute this tag.
 boolean getIgnore()
          Get ignore flag.
 String getName()
          Get the name.
 String getScope()
          Get scope.
static int getScope(String scopeName)
          Converts the scope name into its corresponding PageContext constant value.
 int getScopeId()
          Get scope value from string value.
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 setIgnore(boolean ignore)
          Set ignore flag.
 void setName(String name)
          Set the name.
 void setScope(String scope)
          Set the scope.
 
Methods inherited from class org.apache.tiles.jsp.taglib.TilesTag
doCatch, doFinally, release
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, 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
 

Field Detail

scopeName

protected String scopeName
The scope name.


scope

protected int scope
The scope.


name

protected String name
The name of the attribute.


ignore

protected boolean ignore
Flag that, if true, ignores exceptions.


container

protected TilesContainer container
The Tiles container to use.


attributeContext

protected AttributeContext attributeContext
The current attribute context.


attribute

protected Attribute attribute
The found attribute.


attributeValue

protected Object attributeValue
The attribute value.

Since:
2.1.0
Constructor Detail

AttributeTagSupport

public AttributeTagSupport()
Method Detail

setScope

public void setScope(String scope)
Set the scope.

Parameters:
scope - Scope.

getScope

public String getScope()
Get scope.

Returns:
Scope.

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 TilesTag

doStartTag

public int doStartTag()
               throws TilesJspException

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

execute

public abstract void execute()
                      throws TilesJspException,
                             IOException
Execute this tag. It is called inside doEndTag().

Throws:
TilesJspException - If something goes wrong during rendering.
IOException - If something goes wrong during writing content.

doEndTag

public int doEndTag()

Specified by:
doEndTag in interface Tag
Overrides:
doEndTag in class TagSupport

getScopeId

public int getScopeId()
               throws TilesJspException
Get scope value from string value.

Returns:
Scope as an int, or defaultValue if scope is null.
Throws:
TilesJspException - Scope name is not recognized as a valid scope.

getScope

public static int getScope(String scopeName)
                    throws TilesJspException
Converts the scope name into its corresponding PageContext constant value.

Parameters:
scopeName - Can be "page", "request", "session", or "application" in any case.
Returns:
The constant representing the scope (ie. PageContext.REQUEST_SCOPE).
Throws:
TilesJspException - if the scopeName is not a valid name.

getName

public String getName()
Get the name.

Returns:
Name.

setName

public void setName(String name)
Set the name.

Parameters:
name - The new name

setIgnore

public void setIgnore(boolean ignore)
Set ignore flag.

Parameters:
ignore - default: false: Exception is thrown when attribute is not found, set to true to ignore missing attributes silently

getIgnore

public boolean getIgnore()
Get ignore flag.

Returns:
default: false: Exception is thrown when attribute is not found, set to true to ignore missing attributes silently


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