*
*/
@SuppressWarnings("unchecked")
protected ActionInvocation invokeAction(DispatcherUtils du, HttpServletRequest request, HttpServletResponse response, ServletContext context, ActionDefinition actionDefinition, Map<String, String> params) throws ServletException
{
ActionMapping mapping = getActionMapping(actionDefinition, params);
Map<String, Object> extraContext = du.createContextMap(request, response, mapping, context);
// If there was a previous value stack, then create a new copy and pass it in to be used by the new Action
OgnlValueStack stack = (OgnlValueStack) request.getAttribute(ServletActionContext.WEBWORK_VALUESTACK_KEY);
if (null != stack)
{
extraContext.put(ActionContext.VALUE_STACK, new OgnlValueStack(stack));
}
try
{
prepareContinuationAction(request, extraContext);
ActionProxy proxy = ActionProxyFactory.getFactory().createActionProxy(actionDefinition.getNamespace(), actionDefinition.getAction(), extraContext, actionDefinition.isExecuteResult(), false);
proxy.setMethod(actionDefinition.getMethod());
request.setAttribute(ServletActionContext.WEBWORK_VALUESTACK_KEY, proxy.getInvocation().getStack());
// if the ActionMapping says to go straight to a result, do it!
if (mapping.getResult() != null)
{
Result result = mapping.getResult();
result.execute(proxy.getInvocation());
}
else
{
proxy.execute();