commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject cvs commit: jakarta-commons/latka/src/java/org/apache/commons/latka/jelly ParameterTag.java LatkaTagLibrary.java HttpTag.java
Date Sat, 06 Jul 2002 16:46:44 GMT
dion        2002/07/06 09:46:44

  Modified:    latka/src/java/org/apache/commons/latka/jelly
                        LatkaTagLibrary.java HttpTag.java
  Added:       latka/src/java/org/apache/commons/latka/jelly
                        ParameterTag.java
  Log:
  Added parameter tag
  
  Revision  Changes    Path
  1.5       +5 -4      jakarta-commons/latka/src/java/org/apache/commons/latka/jelly/LatkaTagLibrary.java
  
  Index: LatkaTagLibrary.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/latka/src/java/org/apache/commons/latka/jelly/LatkaTagLibrary.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- LatkaTagLibrary.java	4 Jul 2002 16:41:51 -0000	1.4
  +++ LatkaTagLibrary.java	6 Jul 2002 16:46:44 -0000	1.5
  @@ -81,6 +81,7 @@
           registerTag("suite", SuiteTag.class);
           registerTag("session", SessionTag.class);
           registerTag("get", GetTag.class);
  +        registerTag("parameter", ParameterTag.class);
       }
       
       /**
  
  
  
  1.8       +6 -5      jakarta-commons/latka/src/java/org/apache/commons/latka/jelly/HttpTag.java
  
  Index: HttpTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/latka/src/java/org/apache/commons/latka/jelly/HttpTag.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- HttpTag.java	6 Jul 2002 14:31:09 -0000	1.7
  +++ HttpTag.java	6 Jul 2002 16:46:44 -0000	1.8
  @@ -145,6 +145,8 @@
        * @throws Exception when an error occurs
        */
       public void doTag(XMLOutput xmlOutput) throws Exception {
  +        // allow nested tags first
  +        invokeBody(xmlOutput);
           // retrieve and configure url method
           HttpUrlMethod urlMethod = getHttpUrlMethod();
           urlMethod.setFollowRedirects(isFollowRedirects());
  @@ -168,7 +170,6 @@
           if (getId() != null) {
               getContext().setVariable(getId(), urlMethod);
           }
  -        invokeBody(xmlOutput);
       }
   
       /**
  
  
  
  1.1                  jakarta-commons/latka/src/java/org/apache/commons/latka/jelly/ParameterTag.java
  
  Index: ParameterTag.java
  ===================================================================
  /*
   * ParameterTag.java
   *
   * Created on July 7, 2002, 2:13 AM
   */
  
  package org.apache.commons.latka.jelly;
  
  import org.apache.commons.jelly.XMLOutput;
  
  /**
   * A tag to hold parameters
   * 
   * @author  dion
   * @version $Id: ParameterTag.java,v 1.1 2002/07/06 16:46:44 dion Exp $
   */
  public class ParameterTag extends LatkaTag {
      /** parameter name */
      private String _name;
      /** parameter value */
      private String _value;
      
      /** Creates a new instance of ParameterTag */
      public ParameterTag() {
      }
  
      /**
       * Perform the tag functionality. In this case, simply evaluate the body.
       *
       * @param xmlOutput where to send output
       * @throws Exception when an error occurs
       */
      public void doTag(XMLOutput xmlOutput) throws Exception {
          HttpTag http = (HttpTag) findAncestorWithClass(HttpTag.class);
          http.addParameter(getName(), getValue());
          invokeBody(xmlOutput);
      }
  
      //--------------------------------------------------------------------------
      // Property accessors/mutators
      //--------------------------------------------------------------------------
      /**
       * Getter for property name.
       *
       * @return Value of property name.
       */
      public String getName() {
          return _name;
      }
      
      /**
       * Setter for property name.
       *
       * @param name New value of property name.
       */
      public void setName(String name) {
          _name = name;
      }
      
      /**
       * Getter for property value.
       *
       * @return Value of property value.
       */
      public String getValue() {
          return _value;
      }
      
      /**
       * Setter for property value.
       *
       * @param value New value of property value.
       */
      public void setValue(String value) {
          _value = value;
      }
      
  }
  
  
  

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message