首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件架构设计 >

Struts1.3.10深入源代码之核心种ActionForward类

2012-09-06 
Struts1.3.10深入源代码之核心类ActionForward类Action类的execute()方法返回一个ActionForward对象。Actio

Struts1.3.10深入源代码之核心类ActionForward类
  Action类的execute()方法返回一个ActionForward对象。ActionForward对象代表了Web资源的逻辑对象,这里的Web资源可以是JSP页面、JavaServlet或Action。
  下面是ActionForward类的源代码:

package org.apache.struts.action;import org.apache.struts.config.ForwardConfig;public class ActionForward extends ForwardConfig {    /**     * <p>Construct a new instance with default values.</p>     */    public ActionForward() {        this(null, false);    }    /**     * <p>Construct a new instance with the specified path.</p>     *     * @param path Path for this instance     */    public ActionForward(String path) {        this(path, false);    }    /**     * <p>Construct a new instance with the specified <code>path</code> and     * <code>redirect</code> flag.</p>     *     * @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);    }    /**     * <p>Construct a new instance with the specified <code>name</code>,     * <code>path</code> and <code>redirect</code> flag.</p>     *     * @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);    }    /**     * <p>Construct a new instance with the specified values.</p>     *     * @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);    }    /**     * <p>Construct a new instance based on the values of another     * ActionForward.</p>     *     * @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());    }}

热点排行