当前位置: 首页>>代码示例>>Java>>正文


Java ForwardConfig.setExtends方法代码示例

本文整理汇总了Java中org.apache.struts.config.ForwardConfig.setExtends方法的典型用法代码示例。如果您正苦于以下问题:Java ForwardConfig.setExtends方法的具体用法?Java ForwardConfig.setExtends怎么用?Java ForwardConfig.setExtends使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.struts.config.ForwardConfig的用法示例。


在下文中一共展示了ForwardConfig.setExtends方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testProcessForwardConfigClassSubConfigCustomClass

import org.apache.struts.config.ForwardConfig; //导入方法依赖的package包/类
/**
 * Make sure processForwardConfigClass() returns the same class instance
 * if the base config isn't using a custom class.
 */
public void testProcessForwardConfigClassSubConfigCustomClass()
    throws Exception {
    moduleConfig.addForwardConfig(baseForward);

    ForwardConfig customSub = new ActionForward();

    customSub.setName("failure");
    customSub.setExtends("success");
    moduleConfig.addForwardConfig(customSub);

    ForwardConfig result =
        actionServlet.processForwardConfigClass(customSub, moduleConfig,
            null);

    assertSame("The instance returned should be the param given it.",
        customSub, result);
}
 
开发者ID:SonarSource,项目名称:sonar-scanner-maven,代码行数:22,代码来源:TestActionServlet.java

示例2: testProcessForwardConfigClassOverriddenSubConfigClass

import org.apache.struts.config.ForwardConfig; //导入方法依赖的package包/类
/**
 * Test the case where the subconfig has already specified its own config
 * class.  If the code still attempts to create a new instance, an error
 * will be thrown.
 */
public void testProcessForwardConfigClassOverriddenSubConfigClass()
    throws Exception {
    moduleConfig.addForwardConfig(baseForward);

    ForwardConfig customSub =
        new CustomForwardConfigArg("failure", "/failure.jsp");

    customSub.setExtends("success");
    moduleConfig.addForwardConfig(customSub);

    try {
        actionServlet.processForwardConfigClass(customSub, moduleConfig,
            null);
    } catch (Exception e) {
        fail("Exception should not be thrown");
    }
}
 
开发者ID:SonarSource,项目名称:sonar-scanner-maven,代码行数:23,代码来源:TestActionServlet.java

示例3: testProcessActionExtensionWithForwardConfig

import org.apache.struts.config.ForwardConfig; //导入方法依赖的package包/类
/**
 * Test that an ActionConfig's ForwardConfig can inherit from a
 * global ForwardConfig.
 */
public void testProcessActionExtensionWithForwardConfig()
    throws ServletException {
    ForwardConfig forwardConfig = new ForwardConfig();
    forwardConfig.setName("sub");
    forwardConfig.setExtends("success");
    baseAction.addForwardConfig(forwardConfig);

    moduleConfig.addActionConfig(baseAction);
    moduleConfig.addForwardConfig(baseForward);
    actionServlet.processActionConfigExtension(baseAction, moduleConfig);

    forwardConfig = baseAction.findForwardConfig("sub");

    assertEquals("'sub' forward's inheritance was not processed.",
        baseForward.getPath(), forwardConfig.getPath());
}
 
开发者ID:SonarSource,项目名称:sonar-scanner-maven,代码行数:21,代码来源:TestActionServlet.java


注:本文中的org.apache.struts.config.ForwardConfig.setExtends方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。