首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Web前端 >

在web中实例化spring器皿

2012-10-10 
在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>

热点排行