org.apache.taglibs.session
Class SetAttributeTag

java.lang.Object
  |
  +--javax.servlet.jsp.tagext.TagSupport
        |
        +--javax.servlet.jsp.tagext.BodyTagSupport
              |
              +--org.apache.taglibs.session.SetAttributeTag
All Implemented Interfaces:
javax.servlet.jsp.tagext.BodyTag, java.io.Serializable, javax.servlet.jsp.tagext.Tag

public class SetAttributeTag
extends javax.servlet.jsp.tagext.BodyTagSupport

JSP Tag setAttribute, used to set an HttpSession attribute with name name to a String from the body of the tag.

JSP Tag Lib Descriptor

 <name>setAttribute</name>
 <tagclass>org.apache.taglibs.session.SetAttributeTag</tagclass>
 <bodycontent>JSP</bodycontent>
 <info>Sets the value of the session attribute to the content of the tag body.</info>
   <attribute>
     <name>name</name>
     <required>true</required>
     <rtexprvalue>false</rtexprvalue>
   </attribute>
 

Author:
Glenn Nielsen
See Also:
Serialized Form

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_TAG
 
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
Constructor Summary
SetAttributeTag()
           
 
Method Summary
 int doAfterBody()
          Read the body of the setAttribute tag to obtain the attribute value, then set the attribute with name to that value.
 int doStartTag()
          Returns EVAL_BODY_TAG so the body of the tag can be evaluated.
 void setName(java.lang.String str)
          Set the required tag attribute name.
 
Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport
doEndTag, doInitBody, getBodyContent, getPreviousOut, release, 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
 

Constructor Detail

SetAttributeTag

public SetAttributeTag()
Method Detail

doStartTag

public final int doStartTag()
                     throws javax.servlet.jsp.JspException
Returns EVAL_BODY_TAG so the body of the tag can be evaluated.
Overrides:
doStartTag in class javax.servlet.jsp.tagext.BodyTagSupport
Returns:
EVAL_BODY_TAG

doAfterBody

public final int doAfterBody()
                      throws javax.servlet.jsp.JspException
Read the body of the setAttribute tag to obtain the attribute value, then set the attribute with name to that value.
Overrides:
doAfterBody in class javax.servlet.jsp.tagext.BodyTagSupport
Returns:
SKIP_BODY

setName

public final void setName(java.lang.String str)
Set the required tag attribute name.
Parameters:
String - name of session attribute


Copyright ? 2000 Apache Software Foundation. All Rights Reserved.