struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mschach...@locus.apache.org
Subject cvs commit: jakarta-struts/src/share/org/apache/struts/action ActionForm.java ActionMapping.java
Date Thu, 09 Nov 2000 20:34:13 GMT
mschachter    00/11/09 12:34:12

  Modified:    src/share/org/apache/struts/action ActionForm.java
                        ActionMapping.java
  Log:
  - added methods for getting and setting the MultipartRequestHandler in
  ActionForm, this is necessary for automated rollback of file uploading
  - added methods for getting and setting the MultipartRequestHandler class
  name in ActionMapping, so that you can either specify your multipart
  request handler class in your struts config file per action
  
  Revision  Changes    Path
  1.4       +30 -4     jakarta-struts/src/share/org/apache/struts/action/ActionForm.java
  
  Index: ActionForm.java
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/action/ActionForm.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ActionForm.java	2000/10/15 03:29:15	1.3
  +++ ActionForm.java	2000/11/09 20:34:12	1.4
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/action/ActionForm.java,v
1.3 2000/10/15 03:29:15 craigmcc Exp $
  - * $Revision: 1.3 $
  - * $Date: 2000/10/15 03:29:15 $
  + * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/action/ActionForm.java,v
1.4 2000/11/09 20:34:12 mschachter Exp $
  + * $Revision: 1.4 $
  + * $Date: 2000/11/09 20:34:12 $
    *
    * ====================================================================
    * 
  @@ -67,7 +67,9 @@
   import javax.servlet.ServletRequest;
   import javax.servlet.http.HttpServletRequest;
   
  +import org.apache.struts.upload.MultipartRequestHandler;
   
  +
   /**
    * <p>An <strong>ActionForm</strong> is a JavaBean optionally associated
with
    * one or more <code>ActionMappings</code>.  Such a bean will have had its
  @@ -92,7 +94,7 @@
    * </p>
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.3 $ $Date: 2000/10/15 03:29:15 $
  + * @version $Revision: 1.4 $ $Date: 2000/11/09 20:34:12 $
    */
   
   public abstract class ActionForm implements Serializable {
  @@ -105,6 +107,13 @@
        * The controller servlet instance to which we are attached.
        */
       protected ActionServlet servlet = null;
  +    
  +    
  +    /**
  +     * The MultipartRequestHandler for this form, can be
  +     * <code>null</code>
  +     */
  +    protected MultipartRequestHandler multipartRequestHandler;
   
   
       // ------------------------------------------------------------- Properties
  @@ -118,6 +127,19 @@
           return (this.servlet);
   
       }
  +    
  +    
  +    /**
  +     * Return the MultipartRequestHandler for this form
  +     * The reasoning behind this is to give form bean developers
  +     * control over the lifecycle of their multipart requests
  +     * through the use of the finish() and/or rollback() methods
  +     * of MultipartRequestHandler
  +     * @see org.apache.struts.upload.MultipartRequestHandler
  +     */
  +    public MultipartRequestHandler getMultipartRequestHandler() {
  +        return multipartRequestHandler;
  +    }
   
   
       /**
  @@ -133,6 +155,10 @@
   
       }
   
  +    
  +    public void setMultipartRequestHandler(MultipartRequestHandler multipartRequestHandler)
{
  +        this.multipartRequestHandler = multipartRequestHandler;
  +    }
   
       // --------------------------------------------------------- Public Methods
   
  
  
  
  1.10      +34 -6     jakarta-struts/src/share/org/apache/struts/action/ActionMapping.java
  
  Index: ActionMapping.java
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/action/ActionMapping.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- ActionMapping.java	2000/10/12 21:51:02	1.9
  +++ ActionMapping.java	2000/11/09 20:34:12	1.10
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/action/ActionMapping.java,v
1.9 2000/10/12 21:51:02 craigmcc Exp $
  - * $Revision: 1.9 $
  - * $Date: 2000/10/12 21:51:02 $
  + * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/action/ActionMapping.java,v
1.10 2000/11/09 20:34:12 mschachter Exp $
  + * $Revision: 1.10 $
  + * $Date: 2000/11/09 20:34:12 $
    *
    * ====================================================================
    *
  @@ -138,7 +138,7 @@
    * </ul>
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.9 $ $Date: 2000/10/12 21:51:02 $
  + * @version $Revision: 1.10 $ $Date: 2000/11/09 20:34:12 $
    */
   
   public class ActionMapping {
  @@ -177,8 +177,13 @@
        * The <code>ActionMappings</code> collection of which we are a part.
        */
       protected ActionMappings mappings = null;
  -
  -
  +    
  +    /**
  +     * The fully qualified class name of the <code>MultipartRequestHandler</code>
  +     * implementation class used to process multipart request data for this mapping
  +     */
  +    protected String multipartClass;
  +    
       /**
        * The name of the form bean, if any, associated with this action.
        */
  @@ -467,6 +472,17 @@
           return (this.mappings);
   
       }
  +    
  +    /**
  +     * Get the name of the class used to handle multipart request data
  +     *
  +     * @return A fully qualified java class name representing the implementation of
  +     *         MultipartRequestHandler to use.
  +     */
  +    public String getMultipartClass() {
  +        return multipartClass;
  +    }
  +
   
   
       /**
  @@ -480,6 +496,18 @@
           this.mappings = mappings;
   
       }
  +    
  +    /** 
  +     * Set the name of the class used to handle multipart request data
  +     *
  +     * @param multipartClass The fully qualified class name representing the
  +     *        MultipartRequestHandler class to use.  If <code>null</code>,

  +     *        the global class specified in "web.xml" will be used.
  +     */
  +    public void setMultipartClass(String multipartClass) {
  +        this.multipartClass = multipartClass;
  +    }
  +
   
   
       /**
  
  
  

Mime
View raw message