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; }
/** * 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() ) ); }
"'! 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);