SSM框架配置文件整理(一) applicationContext.xml

本文介绍了SSM框架中applicationContext.xml配置文件的作用,包括Spring容器的创建、数据注入、数据库连接和引入外部文件等核心功能。同时详细讲解了配置文件的组成部分,如xml版本、编码、beans声明以及schemaLocation属性,强调了配置命名空间和xsd规范的重要性,为后续的框架配置提供指导。
摘要由CSDN通过智能技术生成

1.applicationContext.xml配置文件在web项目中的作用

  • spring容器创建
  • 数据注入
  • 连接数据库
  • 引入外部数据文件

以及其他对数据交互、连接外部服务的功能
这些功能是完成SSM框架对web项目作用的基础

2.applicationContext.xml配置文件的组成部分

  1. 表头header
<?xml version="1.0" encoding="UTF-8"?>

version——声明xml版本号
encoding——声明xml传输数据编码
UTF-8——声明编码格式

  1. 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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Zain_horse

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值