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());
}
}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值