struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From craig...@locus.apache.org
Subject cvs commit: jakarta-struts/src/share/org/apache/struts/action ForwardingActionForward.java RedirectingActionForward.java ActionForward.java
Date Sat, 24 Jun 2000 23:26:23 GMT
craigmcc    00/06/24 16:26:23

  Modified:    src/share/org/apache/struts/action ActionForward.java
  Added:       src/share/org/apache/struts/action
                        ForwardingActionForward.java
                        RedirectingActionForward.java
  Log:
  Create two subclasses of ActionForward with different default values for
  the "redirect" property.  Now you can essentially change the global default
  for whether to use RequestDispatcher.forward() or response.sendRedirect()
  by changing which class you define as the value of the "forward"
  initialization parameter to the controller servlet.
  
  Any of the ActionForward implementations let you specifically set the value
  of the "redirect" property if you want to ensure that certain cases are
  always handled the same way.
  
  The default if you do nothing is that ActionForward objects have their
  "redirect" property set to false, so that RequestDispatcher.forward()
  will be used.
  
  Revision  Changes    Path
  1.2       +8 -7      jakarta-struts/src/share/org/apache/struts/action/ActionForward.java
  
  Index: ActionForward.java
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/action/ActionForward.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ActionForward.java	2000/06/16 07:12:18	1.1
  +++ ActionForward.java	2000/06/24 23:26:22	1.2
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/action/ActionForward.java,v
1.1 2000/06/16 07:12:18 craigmcc Exp $
  - * $Revision: 1.1 $
  - * $Date: 2000/06/16 07:12:18 $
  + * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/action/ActionForward.java,v
1.2 2000/06/24 23:26:22 craigmcc Exp $
  + * $Revision: 1.2 $
  + * $Date: 2000/06/24 23:26:22 $
    *
    * ====================================================================
    *
  @@ -87,7 +87,7 @@
    * </ul>
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.1 $ $Date: 2000/06/16 07:12:18 $
  + * @version $Revision: 1.2 $ $Date: 2000/06/24 23:26:22 $
    */
   
   public class ActionForward {
  @@ -127,6 +127,7 @@
       public ActionForward(String path, boolean redirect) {
   
   	super();
  +	setName(null);
   	setPath(path);
   	setRedirect(redirect);
   
  @@ -139,20 +140,20 @@
       /**
        * The logical name of this forward.
        */
  -    private String name = null;
  +    protected String name = null;
   
   
       /**
        * The context-relative (for a forward) or relative or absolute (for a
        * redirect) URI path to be forwarded to.
        */
  -    private String path = null;
  +    protected String path = null;
   
   
       /**
        * Should this be a redirect instead of a forward?
        */
  -    private boolean redirect = false;
  +    protected boolean redirect = false;
   
   
       // ------------------------------------------------------------- Properties
  
  
  
  1.1                  jakarta-struts/src/share/org/apache/struts/action/ForwardingActionForward.java
  
  Index: ForwardingActionForward.java
  ===================================================================
  /*
   * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/action/ForwardingActionForward.java,v
1.1 2000/06/24 23:26:22 craigmcc Exp $
   * $Revision: 1.1 $
   * $Date: 2000/06/24 23:26:22 $
   *
   * ====================================================================
   *
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 1999 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution, if
   *    any, must include the following acknowlegement:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   *
   */
  
  
  package org.apache.struts.action;
  
  
  /**
   * A subclass of <strong>ActionForward</strong> that defaults the
   * <code>redirect</code> attribute to <code>false</code>.
   *
   * @author Craig R. McClanahan
   * @version $Revision: 1.1 $ $Date: 2000/06/24 23:26:22 $
   */
  
  public class ForwardingActionForward extends ActionForward {
  
  
      // ----------------------------------------------------------- Constructors
  
  
      /**
       * Construct a new instance with default values.
       */
      public ForwardingActionForward() {
  
  	this(null);
  
      }
  
  
      /**
       * Construct a new instance with the specified path.
       *
       * @param path Path for this instance
       */
      public ForwardingActionForward(String path) {
  
  	super();
  	setName(null);
  	setPath(path);
  	setRedirect(false);
  
      }
  
  
  }
  
  
  
  1.1                  jakarta-struts/src/share/org/apache/struts/action/RedirectingActionForward.java
  
  Index: RedirectingActionForward.java
  ===================================================================
  /*
   * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/action/RedirectingActionForward.java,v
1.1 2000/06/24 23:26:22 craigmcc Exp $
   * $Revision: 1.1 $
   * $Date: 2000/06/24 23:26:22 $
   *
   * ====================================================================
   *
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 1999 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution, if
   *    any, must include the following acknowlegement:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   *
   */
  
  
  package org.apache.struts.action;
  
  
  /**
   * A subclass of <strong>ActionForward</strong> that defaults the
   * <code>redirect</code> attribute to <code>true</code>.
   *
   * @author Craig R. McClanahan
   * @version $Revision: 1.1 $ $Date: 2000/06/24 23:26:22 $
   */
  
  public class RedirectingActionForward extends ActionForward {
  
  
      // ----------------------------------------------------------- Constructors
  
  
      /**
       * Construct a new instance with default values.
       */
      public RedirectingActionForward() {
  
  	this(null);
  
      }
  
  
      /**
       * Construct a new instance with the specified path.
       *
       * @param path Path for this instance
       */
      public RedirectingActionForward(String path) {
  
  	super();
  	setName(null);
  	setPath(path);
  	setRedirect(true);
  
      }
  
  
  }
  
  
  

Mime
View raw message