Spring4.0的Schema文件

Spring4.0的Schema文件

spring xml配置文件头命名空间 xsd文件配置

Schema文件说明
spring-beans-4.0.xsd [说明]:Spring4.0最主要的Schema,用于配置Bean
[命名空间]:http://www.springframework.org/schema/beans
[Schema文件]:http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
spring-aop-4.0.xsd [说明]:AOP的配置定义的Schema
[命名空间]:http://www.springframework.org/schema/aop
[Schema文件]:http://www.springframework.org/schema/aop/spring-aop-4.0.xsd
spring-tx-4.0.xsd [说明]:声明式事务配置定义的Schema
[命名空间]:http://www.springframework.org/schema/tx
[Schema文件]:http://www.springframework.org/schema/tx/spring-tx-4.0.xsd
spring-mvc-4.0.xsd [说明]:MVC配置的Schema,是Spring3.0新增的
[命名空间]:http://www.springframework.org/schema/mvc
[Schema文件]:http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd
spring-util-4.0.xsd [说明]:为简化某些复杂的标准配置提供的Schema
[命名空间]:http://www.springframework.org/schema/util
[Schema文件]:http://www.springframework.org/schema/util/spring-util-4.0.xsd
spring-jee-4.0.xsd [说明]:为简化JavaEE中EJB、JNDI等功能的配置而提供的Schema
[命名空间]:http://www.springframework.org/schema/jee
[Schema文件]:http://www.springframework.org/schema/jee/spring-jee-4.0.xsd
spring-jdbc-4.0.xsd [说明]:为配置Spring内嵌数据库提供的Schema,是Spring3.0新增的
[命名空间]:http://www.springframework.org/schema/jdbc
[Schema文件]:http://www.springframework.org/schema/jdbc/spring-jdbc-4.0.xsd
spring-jms-4.0.xsd [说明]:JMS配置的Schema
[命名空间]:http://www.springframework.org/schema/jms
[Schema文件]:http://www.springframework.org/schema/jms/spring-jms-4.0.xsd
spring-lang-4.0.xsd [说明]:增加了对JRuby和Grooy等动态语言的支持,该Schema是为集成动态语言而定义的
[命名空间]:http://www.springframework.org/schema/lang
[Schema文件]:http://www.springframework.org/schema/lang/spring-lang-4.0.xsd
spring-oxm-4.0.xsd [说明]:配置对象XML映射的Scheme,是Spring3.0新增的
[命名空间]:http://www.springframework.org/schema/oxm
[Schema文件]:http://www.springframework.org/schema/oxm/spring-oxm-4.0.xsd
spring-task-4.0.xsd [说明]:任务调度的Schema
[命名空间]:http://www.springframework.org/schema/task
[Schema文件]:http://www.springframework.org/schema/task/spring-task-4.0.xsd
spring-tool-4.0.xsd [说明]:为集成Spring的一些有用工具定义的Schema
[命名空间]:http://www.springframework.org/schema/tool
[Schema文件]:http://www.springframework.org/schema/tool/spring-tool-4.0.xsd

示例:

<?xml version="1.0" encoding="UTF-8"?>
<beans 
xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/aop
        http://www.springframework.org/schema/aop/spring-aop.xsd">
</beans>

xmlns=“http://www.springframework.org/schema/beans” ;
默认命名空间

xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance
xsi标准命名空间,用于指定自定义命名空间的Schema文件

xmlns:aop=“http://www.springframework.org/schema/aop
自定义命名空间
aop是该命名空间的简称
http://www.springframework.org/schema/aop 命名空间的全称,必须在xsi命名空间为其指定空间对应的Schema文件

xsi:schemaLocation="…"
为每个命名空间指定具体的Schema文件
语法为:
<命名空间1>——<命名空间1Schema文件>——<命名空间2>——<命名空间2Schema文件>
——代表空格或回车分隔符

命名空间一般写全称,Schema文件就是 .xsd文件

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值