springMVC与spring集成

来源:互联网 发布:python中文分词代码 编辑:程序博客网 时间:2024/05/19 12:12

1.需要在web.xml中添加spring的配置:

  <context-param>        <param-name>contextConfigLocation</param-name>        <param-value>classpath*:config/applicationContext.xml</param-value>  </context-param>    <!--   配置spring启动listener入口 -->  <listener>     <listener-class>org.springframework.web.context.ContextLoaderListener</listener- class>  </listener>

2.创建spring的配置文件applicationContext.xml:

0 0
原创粉丝点击