cmlenz      2002/08/01 07:38:55

  Modified:    src/taglib/common/org/apache/slide/taglib/tag
                        DomainTagSupport.java NamespaceTagSupport.java
  Log:
  Added support for setting the scope of the exported variable
  
  Revision  Changes    Path
  1.7       +27 -6     
jakarta-slide/src/taglib/common/org/apache/slide/taglib/tag/DomainTagSupport.java
  
  Index: DomainTagSupport.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/taglib/common/org/apache/slide/taglib/tag/DomainTagSupport.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- DomainTagSupport.java     25 Apr 2002 21:12:33 -0000      1.6
  +++ DomainTagSupport.java     1 Aug 2002 14:38:55 -0000       1.7
  @@ -68,6 +68,7 @@
   import javax.servlet.jsp.tagext.TagSupport;
   
   import org.apache.slide.taglib.bean.DomainBean;
  +import org.apache.slide.taglib.util.Scopes;
   
   /**
    * Abstract foundation for tags that represent the Slide domain, and expose 
  @@ -96,6 +97,12 @@
       protected String attrName;
       
       
  +    /**
  +     * Scope where the PageContext should be stored.
  +     */
  +    private int scope;
  +    
  +    
       // ----------------------------------------------------------- Construction
       
       
  @@ -123,7 +130,7 @@
           
           if (domain != null) {
               if (attrName != null) {
  -                pageContext.setAttribute(attrName, domain);
  +                pageContext.setAttribute(attrName, domain, scope);
               }
               
               return EVAL_BODY_INCLUDE;
  @@ -143,7 +150,7 @@
           super.doEndTag();
           
           if (attrName != null) {
  -            pageContext.removeAttribute(attrName);
  +            pageContext.removeAttribute(attrName, scope);
           }
           
           return EVAL_PAGE;
  @@ -157,6 +164,20 @@
           super.release();
           
           init();
  +    }
  +    
  +    
  +    // ------------------------------------------------------------- Properties
  +    
  +    
  +    /**
  +     * Sets the 'scope' attribute.
  +     * 
  +     * @param scope the attribute value
  +     */
  +    public void setScope(String scope) {
  +        
  +        this.scope = Scopes.valueOf(scope);
       }
       
       
  
  
  
  1.6       +25 -15    
jakarta-slide/src/taglib/common/org/apache/slide/taglib/tag/NamespaceTagSupport.java
  
  Index: NamespaceTagSupport.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/taglib/common/org/apache/slide/taglib/tag/NamespaceTagSupport.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- NamespaceTagSupport.java  28 Mar 2002 06:12:05 -0000      1.5
  +++ NamespaceTagSupport.java  1 Aug 2002 14:38:55 -0000       1.6
  @@ -70,6 +70,7 @@
   
   import org.apache.slide.taglib.bean.DomainBean;
   import org.apache.slide.taglib.bean.NamespaceBean;
  +import org.apache.slide.taglib.util.Scopes;
   
   /**
    * Abstract foundation for tags that serve to select a namespace of the Slide 
  @@ -108,6 +109,12 @@
       protected String attrName;
       
       
  +    /**
  +     * Scope where the PageContext should be stored.
  +     */
  +    private int scope;
  +    
  +    
       // ----------------------------------------------------------- Construction
       
       
  @@ -135,7 +142,7 @@
           
           if (namespace != null) {
               if (attrName != null) {
  -                pageContext.setAttribute(attrName, namespace);
  +                pageContext.setAttribute(attrName, namespace, scope);
               }
               
               return EVAL_BODY_INCLUDE;
  @@ -154,8 +161,9 @@
           throws JspException {
           
           if (attrName != null) {
  -            pageContext.removeAttribute(attrName);
  +            pageContext.removeAttribute(attrName, scope);
           }
  +        init();
           
           return EVAL_PAGE;
       }
  @@ -175,23 +183,24 @@
       
       
       /**
  -     * Returns the 'name' attribute.
  +     * Sets the 'name' attribute.
        *
  -     * @return the value of the 'name' attribute
  +     * @param name the attribute value
        */
  -    public String getName() {
  -        return name;
  +    public void setName(String name) {
  +        
  +        this.name = name;
       }
       
       
       /**
  -     * Sets the 'name' attribute.
  -     *
  -     * @param name the attribute value
  +     * Sets the 'scope' attribute.
  +     * 
  +     * @param scope the attribute value
        */
  -    public void setName(String name) {
  +    public void setScope(String scope) {
           
  -        this.name = name;
  +        this.scope = Scopes.valueOf(scope);
       }
       
       
  @@ -263,6 +272,7 @@
           namespace = null;
           name = null;
           attrName = null;
  +        scope = PageContext.PAGE_SCOPE;
       }
       
       
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to