/** * <p>Find and return the <code>ForwardConfig</code> instance defining * how forwarding to the specified logical name should be handled. This is * performed by checking local and then global configurations for the * specified forwarding configuration. If no forwarding configuration * can be found, return <code>null</code>.</p> * * @param name Logical name of the forwarding instance to be returned */ public ActionForward findForward(String name) { ForwardConfig config = findForwardConfig(name); if (config == null) { config = getModuleConfig().findForwardConfig(name); } if (config == null) { if (log.isWarnEnabled()) { log.warn("Unable to find '" + name + "' forward."); } } return ((ActionForward) config); }
ForwardConfig copy = this.findForwardConfig(baseForward.getName());
public void removeForwardPath(String siteName, String path, String forwardName, String forwardPath) throws TgwException { ActionConfig actionConfig = getActionConfig(siteName, path); ForwardConfig forwardConfig = actionConfig .findForwardConfig(forwardName); if (actionConfig == null) { throw new TgwException("action config for " + path + " should not be null"); } if (forwardConfig != null) { actionConfig.removeForwardConfig(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); } }
ancestor = actionConfig.findForwardConfig(ancestorName); ancestor = actionConfig.findForwardConfig(ancestorName);
forwardConfig = actionConfig.findForwardConfig(input);
if (actionConfig != null) { baseConfig = actionConfig.findForwardConfig(ancestor);
baseConfig = actionConfig.findForwardConfig(ancestorName);
public void addForwardConfig(ModuleConfig config, Class actionClass, ActionConfig actionConfig) { ForwardConfig forwardConfig = actionConfig.findForwardConfig(Constants.SUCCESS); if (forwardConfig != null) { return; } String path = null; String actionPath = getPath(actionClass); String[] viewExtension = this.configRule.getViewExtension(); for (int i = 0; i < viewExtension.length; i++) { String file = actionPath + "." + viewExtension[i]; path = this.configRule.getDocRoot() + file; String packageDir = ClassUtil.getPackageName(actionClass); if (packageDir == null) { return; } packageDir = "/" + packageDir.replace('.', '/'); String docRoot = this.configRule.getDocRoot(); path = getExistFilePath(docRoot, packageDir, file, actionConfig, servletContext); if (path == null) { path = getExistResourcePath(docRoot, packageDir, file, actionConfig, servletContext); } if (path != null) { addForwardConfig(config, path, actionConfig); return; } } String message = "View file was not found. " + getPath(actionClass) + "." + viewExtension[this.configRule.getViewExtension().length - 1]; logger.info(message); }