import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;
//struts2 获取ServletContext ServletActionContext.getServletContext();
ServletContext application = getServletContext();
WebApplicationContext wac = WebApplicationContextUtils.getWebApplicationContext(application);
XyManager flightTicketManager = (XyManager) wac.getBean("xyManager ");

本文展示如何在Struts2中整合Spring框架,通过代码示例介绍如何获取Spring管理的Bean,并应用于具体的业务逻辑处理。

1万+

被折叠的 条评论
为什么被折叠?



