net.sourceforge.scopes.taglib
Class CopyTag

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by net.sourceforge.scopes.taglib.CopyTag
All Implemented Interfaces:
java.io.Serializable, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.Tag

public class CopyTag
extends javax.servlet.jsp.tagext.TagSupport

It is a tag that allows to copy an attribute value between scopes. It is particularly useful if you want to expose an attribute that is in some special scopes, such as window scope.
It is encouraged to use this tag only to expose attribute value from special scopes to page scope, so that it can be used in JSP pages.

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
CopyTag()
           
 
Method Summary
 int doStartTag()
           
 java.lang.String getFromScope()
          Returns the scope from which the attribute must be copied.
 java.lang.String getName()
          Returns the name of the attribute to copy.
 java.lang.String getToName()
          Returns the name of the destination attribute.
 java.lang.String getToScope()
          Returns the scope of the destination attribute.
 void release()
           
 void setFromScope(java.lang.String fromScope)
          Sets the scope from which the attribute must be copied.
 void setName(java.lang.String name)
          Sets the name of the attribute to copy.
 void setToName(java.lang.String toName)
          Sets the name of the destination attribute.
 void setToScope(java.lang.String toScope)
          Sets the scope of the destination attribute.
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, doEndTag, 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

CopyTag

public CopyTag()
Method Detail

getName

public java.lang.String getName()
Returns the name of the attribute to copy.

Returns:
The name of the source attribute.

setName

public void setName(java.lang.String name)
Sets the name of the attribute to copy.

Parameters:
name - The name of the source attribute.

getFromScope

public java.lang.String getFromScope()
Returns the scope from which the attribute must be copied. If null the attribute will be searched in every scope.

Returns:
The source scope.

setFromScope

public void setFromScope(java.lang.String fromScope)
Sets the scope from which the attribute must be copied. If null the attribute will be searched in every scope.

Parameters:
fromScope - The source scope.

getToName

public java.lang.String getToName()
Returns the name of the destination attribute. If null the name will be the same as the name of the source attribute

Returns:
The name of destination attribute.

setToName

public void setToName(java.lang.String toName)
Sets the name of the destination attribute. If null the name will be the same as the name of the source attribute

Parameters:
toName - The name of the destination attribute.

getToScope

public java.lang.String getToScope()
Returns the scope of the destination attribute. If null the attribute will be stored in "page" scope.

Returns:
The scope of the destination attribute.

setToScope

public void setToScope(java.lang.String toScope)
Sets the scope of the destination attribute. If null the attribute will be stored in "page" scope.

Parameters:
toScope - The scope of the destination attribute.

doStartTag

public int doStartTag()
               throws javax.servlet.jsp.JspException
Specified by:
doStartTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doStartTag in class javax.servlet.jsp.tagext.TagSupport
Throws:
javax.servlet.jsp.JspException

release

public void release()
Specified by:
release in interface javax.servlet.jsp.tagext.Tag
Overrides:
release in class javax.servlet.jsp.tagext.TagSupport