概述
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());
}
}
最后
以上就是爱笑御姐为你收集整理的Struts1.3.10深入源代码之核心类ActionForward类的全部内容,希望文章能够帮你解决Struts1.3.10深入源代码之核心类ActionForward类所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复