org.apache.struts.taglib.bean
Class DefineTag

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by javax.servlet.jsp.tagext.BodyTagSupport
          extended by org.apache.struts.taglib.bean.DefineTag
All Implemented Interfaces:
Serializable, BodyTag, IterationTag, Tag
Direct Known Subclasses:
NestedDefineTag

public class DefineTag
extends BodyTagSupport

Define a scripting variable based on the value(s) of the specified bean property.

Version:
$Rev: 471754 $ $Date: 2005-06-15 12:16:32 -0400 (Wed, 15 Jun 2005) $
See Also:
Serialized Form

Field Summary
protected  String body
          The body content of this tag (if any).
protected  String id
          The name of the scripting variable that will be exposed as a page scope attribute.
protected static MessageResources messages
          The message resources for this package.
protected  String name
          The name of the bean owning the property to be exposed.
protected  String property
          The name of the property to be retrieved.
protected  String scope
          The scope within which to search for the specified bean.
protected  String toScope
          The scope within which the newly defined bean will be creatd.
protected  String type
          The fully qualified Java class name of the value to be exposed.
protected  String value
          The (String) value to which the defined bean will be set.
 
Fields inherited from class javax.servlet.jsp.tagext.BodyTagSupport
bodyContent
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
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
DefineTag()
           
 
Method Summary
 int doAfterBody()
          Save the body content of this tag (if any), or throw a JspException if the value was already defined.
 int doEndTag()
          Retrieve the required property and expose it as a scripting variable.
 int doStartTag()
          Check if we need to evaluate the body of the tag
 String getId()
           
 String getName()
           
 String getProperty()
           
 String getScope()
           
 String getToScope()
           
 String getType()
           
 String getValue()
           
 void release()
          Release all allocated resources.
 void setId(String id)
           
 void setName(String name)
           
 void setProperty(String property)
           
 void setScope(String scope)
           
 void setToScope(String toScope)
           
 void setType(String type)
           
 void setValue(String value)
           
 
Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport
doInitBody, getBodyContent, getPreviousOut, setBodyContent
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
findAncestorWithClass, getParent, getValue, getValues, removeValue, 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

messages

protected static MessageResources messages
The message resources for this package.


body

protected String body
The body content of this tag (if any).


id

protected String id
The name of the scripting variable that will be exposed as a page scope attribute.


name

protected String name
The name of the bean owning the property to be exposed.


property

protected String property
The name of the property to be retrieved.


scope

protected String scope
The scope within which to search for the specified bean.


toScope

protected String toScope
The scope within which the newly defined bean will be creatd.


type

protected String type
The fully qualified Java class name of the value to be exposed.


value

protected String value
The (String) value to which the defined bean will be set.

Constructor Detail

DefineTag

public DefineTag()
Method Detail

getId

public String getId()
Overrides:
getId in class TagSupport

setId

public void setId(String id)
Overrides:
setId in class TagSupport

getName

public String getName()

setName

public void setName(String name)

getProperty

public String getProperty()

setProperty

public void setProperty(String property)

getScope

public String getScope()

setScope

public void setScope(String scope)

getToScope

public String getToScope()

setToScope

public void setToScope(String toScope)

getType

public String getType()

setType

public void setType(String type)

getValue

public String getValue()

setValue

public void setValue(String value)

doStartTag

public int doStartTag()
               throws JspException
Check if we need to evaluate the body of the tag

Specified by:
doStartTag in interface Tag
Overrides:
doStartTag in class BodyTagSupport
Throws:
JspException - if a JSP exception has occurred

doAfterBody

public int doAfterBody()
                throws JspException
Save the body content of this tag (if any), or throw a JspException if the value was already defined.

Specified by:
doAfterBody in interface IterationTag
Overrides:
doAfterBody in class BodyTagSupport
Throws:
JspException - if value was defined by an attribute

doEndTag

public int doEndTag()
             throws JspException
Retrieve the required property and expose it as a scripting variable.

Specified by:
doEndTag in interface Tag
Overrides:
doEndTag in class BodyTagSupport
Throws:
JspException - if a JSP exception has occurred

release

public void release()
Release all allocated resources.

Specified by:
release in interface Tag
Overrides:
release in class BodyTagSupport


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