private void registerForwardConfigs(ModuleConfig config, ActionConfig actionConfig, Class actionClass) { Field[] fields = actionClass.getFields(); for (int i = 0; i < fields.length; i++) { StrutsConfigAnnotationHandler annHandler = StrutsConfigAnnotationHandlerFactory.getAnnotationHandler(); StrutsActionForwardConfig actionForward = annHandler.createStrutsActionForwardConfig(fields[i]); if (actionForward != null) { fields[i].setAccessible(true); String name = FieldUtil.get(fields[i], actionClass).toString(); ForwardConfig forwardConfig = this.defaultRule.createActionForwardConfig(config, actionClass, name, actionForward); actionConfig.addForwardConfig(forwardConfig); } } this.defaultRule.addForwardConfig(config, actionClass, actionConfig); }
protected void addForwardConfig(ModuleConfig config, String path, ActionConfig actionConfig) { ForwardConfig forwardConfig = (ForwardConfig) ClassUtil.newInstance(config.getActionForwardClass()); forwardConfig.setName(Constants.SUCCESS); forwardConfig.setPath(path); actionConfig.addForwardConfig(forwardConfig); }
public void addForwardPath(String siteName, String path, String forwardName, String forwardPath) throws TgwException { ActionConfig actionConfig = getActionConfig(siteName, path); // null-check of actionConfig if (actionConfig == null) { throw new TgwException("action config for " + path + " should not be null"); } ForwardConfig forwardConfig = actionConfig .findForwardConfig(forwardName); if (forwardConfig == null) { forwardConfig = new ActionForward(forwardName, forwardPath, false); actionConfig.addForwardConfig(forwardConfig); } }
actionConfig.addForwardConfig(newForwardConfig); } else {
newActionConfig.addForwardConfig(forwards[i]);
newActionConfig.addForwardConfig(forwards[i]);
BeanUtils.copyProperties(copy, baseForward); this.addForwardConfig(copy); copy.setProperties(baseForward.copyProperties()); } else {
cfg.setRedirect(fConfigs[x].getRedirect()); config.removeForwardConfig(fConfigs[x]); config.addForwardConfig(cfg);