com.boylesoftware.cb2.presentation.servlet
Class InsertTag

java.lang.Object
  extended byjavax.servlet.jsp.tagext.TagSupport
      extended bycom.boylesoftware.cb2.presentation.servlet.InsertTag
All Implemented Interfaces:
javax.servlet.jsp.tagext.IterationTag, java.io.Serializable, javax.servlet.jsp.tagext.Tag

public final class InsertTag
extends javax.servlet.jsp.tagext.TagSupport

Implementation of the <cb2:insert> JSP tag. This tag inserts a component or a page attribtue value, which may be configured for the page in the pages-config.xml file. The input for this tag is a name of a component reference or a page attribute. The name can be specified statically right in the tag instance using name attribute, or it can be provided as a bean property named by nameProperty and nameBean attributes. The tag looks up the bean using PageContext.findAttribute method. If only nameProperty is specified and no nameBean, then an attribute with the specified by the attribute name is assumed to be a String and is used as the component reference or page attribute name.

This tag works in tight conjunction with the ShowPageAction action handler.

Version:
$Id: InsertTag.java,v 1.6 2004/03/10 22:53:14 levahim Exp $
Author:
Lev Himmelfarb
See Also:
Serialized Form

Field Summary
 
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
InsertTag()
           
 
Method Summary
 int doEndTag()
          Does the actual job at the tag's end preparing required beans in the page context and inserting the content.
 int doStartTag()
          This implementation just skips the tag's whole body doing nothing.
 boolean getIgnoreIfAbsent()
          Gets the ignoreIfAbsent attribute for the tag.
 java.lang.String getName()
          Gets the name of the component reference or the attribute as it is configured by componentref or attribute element in the configuration file.
 java.lang.String getNameBean()
          Gets the name of the bean containing component reference or page attribute name.
 java.lang.String getNameProperty()
          Gets name of the property in the nameBean bean containing component reference or page attribute name.
 void release()
          Release the tag.
 void setIgnoreIfAbsent(boolean ignoreIfAbsent)
          Sets the ignoreIfAbsent attribute for the tag.
 void setName(java.lang.String name)
          Sets the name of the component reference or the attribute as it is configured by componentref or attribute element in the configuration file.
 void setNameBean(java.lang.String nameBean)
          Sets the name of the bean containing component reference or page attribute name.
 void setNameProperty(java.lang.String nameProperty)
          Sets name of the property in the nameBean bean containing component reference or page attribute name.
 
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
 

Constructor Detail

InsertTag

public InsertTag()
Method Detail

getName

public java.lang.String getName()
Gets the name of the component reference or the attribute as it is configured by componentref or attribute element in the configuration file.

Returns:
the componentref or attribute name.

setName

public void setName(java.lang.String name)
Sets the name of the component reference or the attribute as it is configured by componentref or attribute element in the configuration file.

Parameters:
name - the componentref or attribute name.

getNameBean

public java.lang.String getNameBean()
Gets the name of the bean containing component reference or page attribute name.

Returns:
the bean name.

setNameBean

public void setNameBean(java.lang.String nameBean)
Sets the name of the bean containing component reference or page attribute name.

Parameters:
nameBean - the bean name.

getNameProperty

public java.lang.String getNameProperty()
Gets name of the property in the nameBean bean containing component reference or page attribute name.

Returns:
the property name.

setNameProperty

public void setNameProperty(java.lang.String nameProperty)
Sets name of the property in the nameBean bean containing component reference or page attribute name.

Parameters:
nameProperty - the property name.

getIgnoreIfAbsent

public boolean getIgnoreIfAbsent()
Gets the ignoreIfAbsent attribute for the tag.

Returns:
true if ignoreIfAbsent flag is set.

setIgnoreIfAbsent

public void setIgnoreIfAbsent(boolean ignoreIfAbsent)
Sets the ignoreIfAbsent attribute for the tag. If set to true the tag will be ignored if no component nor attribute with the specified name is defined for the page. If set to false, which is the default, an exception will be thrown in such a case.

Parameters:
ignoreIfAbsent - value for the ignoreIfAbsent attribute.

doStartTag

public int doStartTag()
This implementation just skips the tag's whole body doing nothing. The functionality of the tag is implemented in the doEndTag method.

Returns:
Tag.SKIP_BODY.

doEndTag

public int doEndTag()
             throws javax.servlet.jsp.JspException
Does the actual job at the tag's end preparing required beans in the page context and inserting the content.

Returns:
Tag.EVAL_PAGE.
Throws:
javax.servlet.jsp.JspException - if an error occured.

release

public void release()
Release the tag.



Copyright © 2002,2003,2004 - Boyle Software, Inc.