您的位置:首页 > 编程语言 > Java开发

web.xml中配置Spring容器随项目启动

2018-03-17 16:59 531 查看
 <!-- 可以让spring容器随项目的启动而创建,随项目的关闭而销毁 -->
  <listener>
  <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
  </listener>
  <!-- 指定加载spring配置文件的位置 -->
  <context-param>
  <param-name>contextConfigLocation</param-name>
  <param-value>classpath:applicationContext.xml</param-value>
  </context-param>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐