params.put("method", action.getMethod());
}
return buildResult(resultCode, resultTypeConfig, context, params);
} else if (prefix.startsWith("redirect")) {
String targetResource = StringUtils.substringAfter(resultCode, ":");
if (StringUtils.contains(targetResource, ':')) { return new ServletRedirectResult(
targetResource); }
Action action = buildAction(targetResource);
// add special param and ajax tag for redirect
HttpServletRequest request = ServletActionContext.getRequest();
String redirectParamStr = request.getParameter("params");
action.params(redirectParamStr);
// x-requested-with->XMLHttpRequest
if (null != request.getHeader("x-requested-with")) {
action.param("x-requested-with", "1");
}
Map<String, String> params = buildResultParams(path, resultTypeConfig);
if (null != action.getParams().get("method")) {
params.put("method", (String) action.getParams().get("method"));
action.getParams().remove("method");
}
if (StringUtils.isNotEmpty(action.getMethod())) {
params.put("method", action.getMethod());
}
addNamespaceAction(action, params);
ServletRedirectResult result = (ServletRedirectResult) buildResult(resultCode,
resultTypeConfig, context, params);
for (Map.Entry<String, String> param : action.getParams().entrySet()) {
String property = param.getKey();
result.addParameter(property, param.getValue());
}
return result;
} else {
return buildResult(resultCode, resultTypeConfig, context,
buildResultParams(path, resultTypeConfig));