码迷,mamicode.com
首页 > 编程语言 > 详细

Spring配置xml文件详解

时间:2016-08-29 19:30:28      阅读:173      评论:0      收藏:0      [点我收藏+]

标签:

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 </beans>

第一行:声明此文件xml格式,版本1.0 编码 UTF-8格式

第二行:插入beans标签并引入一个命名空间xmlns="http://www.springframework.org/schema/beans"没有使用命名空间前缀

第三行:xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"声明一个命名空间"http://www.w3.org/2001/XMLSchema-instance"前缀为xsi,此命名空间为xml遵循w3的一个标准标签规范命名空间。

第四行:使用xsi前缀的命名空间属性schemaLocation指定一个命名空间和schema文件的位置,注意顺序。

Spring配置xml文件详解

标签:

原文地址:http://www.cnblogs.com/hihtml5/p/5819101.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!