public class DelegatingActionProxy
extends Action
{
public ActionForward
execute
(
ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
throws Exception {
Action delegateAction =
getDelegateAction
(mapping);//
得到action实例
return delegateAction.
execute
(mapping, form, request, response);
return (Action) wac.getBean(beanName, Action.class);
}
protected WebApplicationContext
getWebApplicationContext
(
ActionServlet actionServlet, ModuleConfig moduleConfig) throws IllegalStateException {
return DelegatingActionUtils.findRequiredWebApplicati
onContext(actionServlet, moduleConfig);
}
protected String determineActionBeanName(ActionMapping mapping) {
return DelegatingActionUtils.
determineActionBeanName
(mapping);
}
}
//在服务器开启服务时会进行一些初始化的工作。其中重要的一份工作就是初始化ModuleConfig。ModuleConfig是和struts配置文件相对应的,说的具体点是和<struts-config>对应的。一个配置文件对应一个moduleconfig。
//用来标志和区分ModuleConfig类,同时在使用上面的config类初始化相应的资源以后,也是通过这个prefix来区分所属的不同的web模块。
}