本文整理汇总了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);
}
示例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");
}
}
示例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());
}