版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/u010741376/article/details/51209513
ServletContext application = ServletActionContext.getRequest().getSession().getServletContext();
ApplicationContext context = WebApplicationContextUtils.getWebApplicationContext(application);
// WebApplicationContextUtils.getRequiredWebApplicationContext(application);
UserDao bd = (UserDao)context.getBean(spring中配置bean ID的名称);