aRequest.setAttribute("webwork.request_url", aRequest.getRequestURL());
ServletActionContext.setContext(aRequest, aResponse, getServletContext(), actionName);
gd.prepareValueStack();
ActionResult ar = null;
try
{
gd.executeAction();
ar = gd.finish();
}
catch (Throwable e)
{
log.warn("Could not execute action:" + e.getMessage());
try
{
aResponse.sendError(404, "Could not execute action [" + actionName + "]:" + e.getMessage() + getHTMLErrorMessage(e));
}
catch (IOException e1)
{
}
}
if (ar != null && ar.getActionException() != null)
{
log.warn("Could not execute action:" + ar.getActionException().getMessage());
//log.error("Could not execute action", ar.getActionException());
try
{
aResponse.sendError(500, ar.getActionException().getMessage() + getHTMLErrorMessage(ar.getActionException()));
}
catch (IOException e1)
{
}
}
// check if no view exists
if (ar != null && ar.getResult() != null && ar.getView() == null && !ar.getResult().equals(Action.NONE)) {
try
{
aResponse.sendError(404, "No view for result [" + ar.getResult() + "] exists for action [" + actionName + "]");
}
catch (IOException e)
{
}
}
if (ar != null && ar.getView() != null && ar.getActionException() == null)
{
String view = ar.getView().toString();
log.debug("Result:" + view);
RequestDispatcher dispatcher = null;
try
{