编写applicationContext.xml

前面编写的三层的spring的配置文件需要整合到一个总的配置文件:applicationContext.xml

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <beans xmlns="http://www.springframework.org/schema/beans"
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4. xsi:schemaLocation="http://www.springframework.org/schema/beans
  5. http://www.springframework.org/schema/beans/spring-beans.xsd">
  6. <import resource="spring-dao.xml"/>
  7. <import resource="spring-service.xml"/>
  8. <import resource="spring-mvc.xml"/>
  9. </beans>

至此为止,需要配置的基本文件一共6个,其配置内容基本不会有太大的改动。
image.png

本小项目截图

image.png
image.pngimage.png