HttpServletRequest request,
HttpServletResponse response)
throws Exception {
// Set up a context for this request
Context context = new ServletWebContext
(getServlet().getServletContext(), request, response);
context.put("mapping", mapping);
context.put("form", form);
// Delegate to the specified command
Command command = getCatalog().getCommand(mapping.getParameter());
command.execute(context); // Ignore return state
// Return results as appropriate
Exception exception = null;
try {
exception = (Exception) context.get("exception");
if (exception != null) {
throw exception;
}
} catch (ClassCastException e) {
; // It is not an Exception
}
ActionForward forward = null;
try {
forward = (ActionForward) context.get("forward");
} catch (ClassCastException e) {
forward = null; // It is not an ActionForward
}
return forward;