Java

来源:互联网 发布:软件过程 编辑:程序博客网 时间:2024/06/06 03:42

如果需要在Web项目中使用Spring的IoC容器,可以在Web项目配置文件web.xml中做出如下配置:

<context-param>    <param-name>contextConfigLocation</param-name>    <param-value>classpath:applicationContext.xml</param-value></context-param><listener>    <listener-class>        org.springframework.web.context.ContextLoaderListener    </listener-class></listener>

原创粉丝点击