好记性不如烂笔头89-spring3学习(10)-spring3常用schema(持续整理)

来源:互联网 发布:浙江卫视网络直播 编辑:程序博客网 时间:2024/05/18 01:52

Spring3有很多的schema,这些schema对应很多不同的功能。使用这些常用的schema,能让我们避免重复发明轮子,提高我们的开发效率。
我以为这是一个很常见的信息,到网上随便整理下就能完成,可能用的关键词不对,怎么找也没有找到相对比较全面的。

正所谓,好记性不如烂笔头,自己动手把自己能收集到的整理下来,以后需要找资料也能方便点。

spring-beans-3.0.xsd

用途:spring3最主要的schema,用于配置bean命名空间: http://www.springframework.org/schema/beansSchema文件: http://www.springframework.org/schema/beans/spring-beans-3.0.xsd

P命名空间

用户:简化XML配置命名空间:http://www.springframework.org/schema/p引入方法:xmlns:p="http://www.springframework.org/schema/p"因为p命名空间中的属性名是可变的,因此他没有对应的schema定义文件,也不需要在xsi:schemaLocation中为p命名空间指定schema定义文件。

spring-context-3.0.xsd

用途:它提供了通过扫描类包,以应用注解定义bean的方法,spring2.5以后提供命名空间: http://www.springframework.org/schema/contextSchema文件: http://www.springframework.org/schema/tx/spring-context-3.0.xsd样例:<context:component-scan base-package=”com.dao”/>Spring容器会扫描com.dao下面所有的类,并且从类的注解中获取bean的定义信息;Context命名空间的方法比较多,比如:resource-pattern 属性过滤特定的类;Regex 方法,采用正则表达式对目标的类名进行过滤等。

spring-tx-3.0.xsd

用途:用于声明式事务配置定义命名空间: http://www.springframework.org/schema/txSchema文件: http://www.springframework.org/schema/tx/spring-tx-3.0.xsd

spring-aop-3.0.xsd

用途:AOP(面向切面)的配置定义命名空间: http://www.springframework.org/schema/aopSchema文件:http://www.springframework.org/schema/aop/spring-aop-3.0.xsd

spring-mvc-3.0.xsd

用途:用于MVC的配置,spring3.0新增命名空间: http://www.springframework.org/schema/mvcSchema文件:http://www.springframework.org/schema/aop/spring-mvc-3.0.xsd

pring-jdbc-3.0.xsd

用途:用于spring内嵌数据库提供的配置,spring3.0新增命名空间: http://www.springframework.org/schema/jdbcSchema文件:http://www.springframework.org/schema/aop/spring-jdbc-3.0.xsdspring内嵌数据库又是一个什么样东东呢?

spring-lang-3.0.xsd

用途:spring3.0新增了对JRuby和Groovy等动态语言的支持命名空间: http://www.springframework.org/schema/langSchema文件:http://www.springframework.org/schema/aop/spring-lang-3.0.xsd

pring-oxm-3.0.xsd

用途:用于配置对象XML映射的schema,spring3.0新增命名空间: http://www.springframework.org/schema/oxmSchema文件:http://www.springframework.org/schema/aop/spring-oxm-3.0.xsd

spring-task-3.0.xsd

用途:任务调度的定义和配置命名空间:http://www.springframework.org/schema/taskSchema文件:http://www.springframework.org/schema/task/spring-task-3.0.xsd
0 0