All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.apache.struts.action.ActionForward Maven / Gradle / Ivy

/*
 * $Id: ActionForward.java 471754 2006-11-06 14:55:09Z husted $
 *
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *  http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
package org.apache.struts.action;

import org.apache.struts.config.ForwardConfig;

/**
 * 

An ActionForward represents a destination to which the * controller, RequestProcessor, might be directed to perform a * RequestDispatcher.forward or HttpServletResponse.sendRedirect to, as a * result of processing activities of an Action class. Instances of this class * may be created dynamically as necessary, or configured in association with * an ActionMapping instance for named lookup of potentially multiple * destinations for a particular mapping instance.

* *

An ActionForward has the following minimal set of properties. Additional * properties can be provided as needed by subclassses.

* *
    * *
  • contextRelative - Should the path value be interpreted * as context-relative (instead of module-relative, if it starts with a '/' * character? [false]
  • * *
  • name - Logical name by which this instance may be * looked up in relationship to a particular ActionMapping.
  • * *
  • path - Module-relative or context-relative URI to * which control should be forwarded, or an absolute or relative URI to which * control should be redirected.
  • * *
  • redirect - Set to true if the controller servlet * should call HttpServletResponse.sendRedirect() on the associated path; * otherwise false. [false]
  • * *
* *

Since Struts 1.1 this class extends ForwardConfig and inherits the * contextRelative property. * *

NOTE - This class would have been deprecated and * replaced by org.apache.struts.config.ForwardConfig except for the fact that * it is part of the public API that existing applications are using.

* * @version $Rev: 471754 $ $Date: 2005-08-14 17:24:39 -0400 (Sun, 14 Aug 2005) * $ */ public class ActionForward extends ForwardConfig { /** *

Construct a new instance with default values.

*/ public ActionForward() { this(null, false); } /** *

Construct a new instance with the specified path.

* * @param path Path for this instance */ public ActionForward(String path) { this(path, false); } /** *

Construct a new instance with the specified path and * redirect flag.

* * @param path Path for this instance * @param redirect Redirect flag for this instance */ public ActionForward(String path, boolean redirect) { super(); setName(null); setPath(path); setRedirect(redirect); } /** *

Construct a new instance with the specified name, * path and redirect flag.

* * @param name Name of this instance * @param path Path for this instance * @param redirect Redirect flag for this instance */ public ActionForward(String name, String path, boolean redirect) { super(); setName(name); setPath(path); setRedirect(redirect); } /** *

Construct a new instance with the specified values.

* * @param name Name of this forward * @param path Path to which control should be forwarded or * redirected * @param redirect Should we do a redirect? * @param module Module prefix, if any */ public ActionForward(String name, String path, boolean redirect, String module) { super(); setName(name); setPath(path); setRedirect(redirect); setModule(module); } /** *

Construct a new instance based on the values of another * ActionForward.

* * @param copyMe An ActionForward instance to copy * @since Struts 1.2.1 */ public ActionForward(ActionForward copyMe) { this(copyMe.getName(), copyMe.getPath(), copyMe.getRedirect(), copyMe.getModule()); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy