@Override
protected ViewAdapter executeAction(Object actionBean, ActionContext context)
{
NavigableSubmitAction action = (NavigableSubmitAction) actionBean;
ActionForm form = context.getForm();
HttpServletRequest request = context.getRequest();
boolean cancelled = false;
if (request.getAttribute(Globals.CANCEL_KEY) != null)
{
cancelled = true;
}
if (form instanceof BindingForm && !cancelled)
{
action.preBind();
BindingForm validBindingForm = (BindingForm) form;
validBindingForm.bindInwards(actionBean);
}
ActionMapping mapping = context.getMapping();
if (cancelled)
{
action.cancel();
}
else
{
// now figure out what method to execute and do so
String parameterName = mapping.getParameter();
getHelper().checkParameterName(mapping, parameterName);
String methodName = getMethodName(context, parameterName);
if (methodName == null)
{
action.execute();
}
else
{
Method method = getHelper().getMethod(actionBean, methodName);
ReflectHelper.invokeMethod(actionBean, method, String.class);