在web中实例化spring器皿

在web中实例化spring容器!--指定spring的配置文件,默认从web根目录寻找配置文件,我们可以通过spring提供

在web中实例化spring容器
<!--指定spring的配置文件,默认从web根目录寻找配置文件,我们可以通过spring提供的classpath:前缀指定从类路径下寻找-->
        <context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>classpath:beans.xml</param-value>
</context-param>

<!--对Spring容器进行实例化-->


<listener><listenerclass>org.springframework.web.context.ContextLoaderListener</listener-class></listener>