1.applicationContext.xml配置文件在web项目中的作用
- spring容器创建
- 数据注入
- 连接数据库
- 引入外部数据文件
以及其他对数据交互、连接外部服务的功能
这些功能是完成SSM框架对web项目作用的基础
2.applicationContext.xml配置文件的组成部分
- 表头header
<?xml version="1.0" encoding="UTF-8"?>
version——声明xml版本号
encoding——声明xml传输数据编码
UTF-8——声明编码格式
- beans实例声明
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.3.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-4.3.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-4.3.xsd">
配置内容……
</beans