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 PutTag.java LatkaTagLibrary.java
Date Sun, 07 Jul 2002 17:44:56 GMT
dion        2002/07/07 10:44:56

  Modified:    latka/src/java/org/apache/commons/latka/jelly
                        LatkaTagLibrary.java
  Added:       latka/src/java/org/apache/commons/latka/jelly PutTag.java
  Log:
  Added put tag
  
  Revision  Changes    Path
  1.12      +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.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- LatkaTagLibrary.java	7 Jul 2002 17:23:24 -0000	1.11
  +++ LatkaTagLibrary.java	7 Jul 2002 17:44:56 -0000	1.12
  @@ -85,6 +85,7 @@
           registerTag("delete", DeleteTag.class);
           registerTag("head", HeadTag.class);
           registerTag("options", OptionsTag.class);
  +        registerTag("put", PutTag.class);
           registerTag("parameter", ParameterTag.class);
           registerTag("header", HeaderTag.class);
           registerTag("body", BodyTag.class);
  
  
  
  1.1                  jakarta-commons/latka/src/java/org/apache/commons/latka/jelly/PutTag.java
  
  Index: PutTag.java
  ===================================================================
  /*
   * PostTag.java
   *
   * Created on July 7, 2002, 11:18 AM
   */
  
  package org.apache.commons.latka.jelly;
  
  import java.net.MalformedURLException;
  import org.apache.commons.httpclient.HttpUrlMethod;
  import org.apache.commons.httpclient.methods.UrlPutMethod;
  
  
  /**
   * A http put
   *
   * @author  dion
   * @version $Id: PutTag.java,v 1.1 2002/07/07 17:44:56 dion Exp $
   */
  public class PutTag extends HttpTag {
      
      /** the put method */
      private UrlPutMethod _putMethod;
  
      /** Creates a new instance of PutTag */
      public PutTag() {
      }
      
      /** 
       * Return a {@link HttpUrlMethod method} to be used for put'ing
       *
       * @return a HttpUrlMethod implementation
       * @throws MalformedURLException when the {@link getUrl() url} or
       * {@link #getPath() path} is invalid
       */
      protected HttpUrlMethod getHttpUrlMethod() throws MalformedURLException {
          if (_putMethod == null) {
              _putMethod = new UrlPutMethod(getResolvedUrl());
          }
          return _putMethod;
      }
      
      /** 
       * Set the current parameters on the url method ready for processing
       *
       */
      protected void setParameters() {
      }
      
      /**
       * Fail as PUT requests don't have parameters
       *
       * @param name the parameter name
       * @param value the parameter value
       */
      public void addParameter(String name, String value) {
          throw new IllegalArgumentException("PUT requests don't have params");
      }
  
  }
  
  
  

--
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