/** * Copies the specified result config. * * @param config The config to copy. * @return the copy. */ public static ResultConfig copyResultConfig( final ResultConfig config ) { return new ResultConfig( config.getName(), config.getClassName(), copyParams( config.getParams() ) ); }
private static Map<String, ResultConfig> defaultResults() { Map<String, ResultConfig> results = new HashMap<String, ResultConfig>(); // SUCCESS results in a chaining to another action, as defined by the 'targetAction' field of the OverriddenAction. ResultConfig success = new ResultConfig(); success.setName( OverriddenAction.SUCCESS ); success.setClassName( ActionChainResult.class.getName() ); success.addParam( ActionChainResult.DEFAULT_PARAM, OverriddenAction.SUCCESS_DEFAULT_PARAM ); // ERROR results in a redirect to the 'errors.jsp', although it shouldn't actually get called anyway... ResultConfig error = new ResultConfig(); error.setName( OverriddenAction.ERROR ); error.setClassName( VelocityResult.class.getName() ); error.addParam( VelocityResult.DEFAULT_PARAM, OverriddenAction.ERROR_DEFAULT_PARAM ); results.put( OverriddenAction.SUCCESS, success ); results.put( OverriddenAction.ERROR, error ); return results; }
String resultName = (String) iterator2.next(); ResultConfig resultConfig = ((ResultConfig) actionConfig.getResults().get(resultName)); String resultClassName = resultConfig.getClassName(); || resultClassName.indexOf("Velocity") != -1 || resultClassName.indexOf("Freemarker") != -1) { if (resultConfig.getParams().get("location") == null) { continue; String location = getViewLocation((String) resultConfig.getParams().get("location"), namespace); if (location.endsWith((String) Configuration.get(WebWorkConstants.WEBWORK_ACTION_EXTENSION))) { addTempLink(action, location, Link.TYPE_RESULT, resultConfig.getName()); } else { ViewNode view = new ViewNode(stripLocation(location)); subGraph.addNode(view); addTempLink(action, location, Link.TYPE_RESULT, resultConfig.getName()); String locationConfig = (String) resultConfig.getParams().get("location"); if (locationConfig == null) { locationConfig = (String) resultConfig.getParams().get("actionName"); addTempLink(action, location, Link.TYPE_REDIRECT, resultConfig.getName()); } else { ViewNode view = new ViewNode(stripLocation(location)); subGraph.addNode(view); addTempLink(action, location, Link.TYPE_REDIRECT, resultConfig.getName());
public static File getViewFile(String namespace, String actionName, String resultName) { ResultConfig result = getResultConfig(namespace, actionName, resultName); String location = (String) result.getParams().get("location"); for (int i = 0; i < views.length; i++) { String viewRoot = views[i]; File viewFile = getViewFileInternal(viewRoot, location, namespace); if (viewFile != null) { return viewFile; } } return null; }
public OverriddenResultConfig( ResultConfig originalResult ) { super( originalResult.getName(), OverriddenResult.class ); setOriginalResult( originalResult ); setOverridingResults( new ArrayList<OverridingResultConfig>() ); }
"'! This requires FreeMarker support and won't work if you don't have it installed"); ResultConfig rc = new ResultConfig(WAIT, "com.opensymphony.webwork.views.freemarker.FreemarkerResult", Collections.singletonMap("location", "com/opensymphony/webwork/interceptor/wait.ftl")); results.put(WAIT, rc);
ResultConfig resultConfig = (ResultConfig) invocation.getProxy().getConfig().getResults().get( invocation.getResultCode()); Map resultConfigParams = resultConfig.getParams(); for (Iterator i = resultConfigParams.entrySet().iterator(); i.hasNext(); ) { Map.Entry e = (Map.Entry) i.next();