67,513
社区成员
发帖
与我相关
我的任务
分享
<bean id="myListener" class="com.MyListener" scope="prototype">
<property name="myService" ref="myService"/>
</bean>
ServletContext sc = request.getSession(true).getServletContext();
ApplicationContext beans = WebApplicationContextUtils.getRequiredWebApplicationContext(sc);
MyService service = (MyService) beans.getBean("myService");