如何在web环境中配置applicationContext.xml文件?
<listener>
??<listener-class>
???org.springframework.web.context.ContextLoaderListener
??</listener-class>
?</listener>
?或:
?<servlet>
??<servlet-name>context</servlet-name>
???<servlet-class>
????org.springframework.web.context.ContextLoaderServlet
???</servlet-class>
??<load-on-startup>1</load-on-startup>
?</servlet>
?通过如下方法取出applicationContext实例:
?ApplicationContext ac=WebApplicationContextUtils.getWebApplicationContext(this.getServletContext);