struts1源码研究: org.apache.struts.action.ActionForward

ActionForward继承了下ForwardConfig,然后就写了6个构造函数……然后就没了 汗=。=!
有一句话没翻译出来,有看得懂的来帮个忙吧 :
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.

下面是翻译后的源码。
package  org.apache.struts.action;

import  org.apache.struts.config.ForwardConfig;

/**
 * 一个ActionForward为控制器类RequestProcessor指向了一个目的地,由控制器执行跳转。
 * 但也可能作为Action中的行为,直接执行RequestDispatcher.forward或
 * HttpServletResponse.sendRedirect方法。这个类的实例可以会根据需要被动态创建,
 * 也可以被设定为与一个ActionMapping绑定,通过名字查找这个mapping实例的多个跳转目的地。
 * 
 * 一个ActionForward包含以下几个基本属性,其他的附加属性可以根据需要由子类提供。
 * 
 * contextRelative(上下文关系): path路径值必须被解释为上下文相关路径(context-relative)
 * 
 * name : 用来查找相关的ActionMapping。
 * <li><strong>name</strong> - Logical name by which this instance may be
 * looked up in relationship to a particular ActionMapping. </li>
 *
 * path : 一个让控制器实现转发(forward)的,模型相关/上下文相关URI;或一个让控制器
 * 实现重定向(redirected)的,绝对/相对URI。
 *
 * redirect : 当需要控制器以重定向的方法执行path时则设为true,否则为false
 *
 * 这个类继承了 ForwardConfig 类和 contextRelative属性
 *
 * 注意 :这个类不推荐使用,而应由ForwardConfig取代 ..后面的翻不出来了。
 * 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.</p>
 *          
 
*/
public   class  ActionForward  extends  ForwardConfig {
    
/**
     * 无参构造函数 - 以默认值实例化
     
*/
    
public  ActionForward() {
        
this ( null false );
    }

    
/**
     * 构造函数 - 参数path</p>
     *
     
*/
    
public  ActionForward(String path) {
        
this (path,  false );
    }

    
/**
     * 构造函数 - 参数 path,redirect
     
*/
    
public  ActionForward(String path,  boolean  redirect) {
        
super ();
        setName(
null );
        setPath(path);
        setRedirect(redirect);
    }

    
/**
     *构造函数 - 参数 name,path,redirect
     
*/
    
public  ActionForward(String name, String path,  boolean  redirect) {
        
super ();
        setName(name);
        setPath(path);
        setRedirect(redirect);
    }

    
/**
     * 构造函数 - 参数 name,path,redirect,module 模块前缀
     
*/
    
public  ActionForward(String name, String path,  boolean  redirect,
        String module) {
        
super ();
        setName(name);
        setPath(path);
        setRedirect(redirect);
        setModule(module);
    }

    
/**
     * 构造函数 - 用已有的ActionForward对象实例化。
     
*/
    
public  ActionForward(ActionForward copyMe) {
        
this (copyMe.getName(), copyMe.getPath(), copyMe.getRedirect(),
            copyMe.getModule());
    }
}

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值