<listener>
<listener-class> org.springframework.web.context.ContextLoaderListener < stener-class>
< stener>
<listener>
<listener-class> cn.edu.buaa.iegsa.server.EventInterceptorListener < stener-class>
< stener>
在EventInterceptorListener里边用:
ApplicationContext applicationContext=WebApplicationContextUtils.getRequiredWebApplicationContext(event.getServletContext());
applicationContext.getBean( "dataSource ");
怎么得不到javabean呢?出现的错误是:
org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'dataSource ' is defined
------解决方法--------------------------------------------------------
检查一下的spring配置文件中是不是配置了dataSource这个名称的bean。