我正在将我们的应用程序从旧版本的 struts 升级到最新的“1”版本:1.3.10。现在,我们尝试处理 Action 的代码总是返回一个空的转发对象。我附上了struts源代码,看起来它总是返回null。在升级之前,我们的代码运行良好,并且转发对象在返回时被填充。
forward = super.processActionPerform(request, response, action, formInstance, mapping);
return (forward);
现在,这里是 processActionPerform 的Struts 代码:
protected ActionForward processActionPerform(HttpServletRequest request,
HttpServletResponse response, Action action, ActionForm form,
ActionMapping mapping)
throws IOException, ServletException {
try {
return (action.execute(mapping, form, request, response));
} catch (Exception e) {
return (processException(request, response, e, form, mapping));
}
}
如您所见,这调用了 Action 的执行方法。下面是 Struts 的执行方法代码,你可以看到它总是返回 null。
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
return null;
}
我想知道是否需要更改以使用不同的 Struts 类或方法来使其工作。任何援助将不胜感激。
谢谢!