使用 EventActionDispatcher 的推荐方法如下(根据 API 文档 @ http://struts.apache.org/1.2.9/api/org/apache/struts/actions/EventActionDispatcher.html)
public class MyCustomAction extends Action {
protected ActionDispatcher dispatcher = new EventActionDispatcher(this);
public ActionForward execute(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {
return dispatcher.execute(mapping, form, request, response);
}
}
这样做会在构造函数退出之前发布对“this”的引用吗?管理方法之外的字段分配的规则是什么。
提前致谢。
真诚的,LES