<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"
xmlns:tx="http://www.springframework.org/schema/tx"
    xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
    xmlns:task="http://www.springframework.org/schema/task"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.1.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.1.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.1.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd
http://www.springframework.org/schema/task
http://www.springframework.org/schema/task/spring-task-3.1.xsd">

一:

xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

这个是每个配置文件必须的部分,也就是spring的根本。

  声明xml文件默认的命名空间,表示未使用其他命名空间的所有标签的默认命名空间。

  声明XML Schema 实例,声明后就可以使用 schemaLocation 属性了。

二:

xmlns:aop="http://www.springframework.org/schema/aop"

这个就是spring配置文件里面需要使用到aop的标签,声明前缀为aop的命名空间,后面的URL用于标示命名空间的地址不会被解析器用于查找信息。其惟一的作用是赋予命名空间一个惟一的名称。当命名空间被定义在元素的开始标签中时,所有带有相同前缀的子元素都会与同一个命名空间相关联。然后其他比如context(针对组件标签)、MVC(针对mvc标签)、tx(针对事务标签)都一样的意思。

强制使用CGLIB代理
<aop:aspectj-autoproxy proxy-target-class="true" />

三:

xsi:schemaLaction部分:
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.1.xsd

是为上面配置的命名空间指定xsd规范文件,这样你在进行下面具体配置的时候就会根据这些xsd规范文件给出相应的提示,比如说每个标签是怎么写的,都有些什么属性是都可以智能提示的,以防配置中出错而不太容易排查,在启动服务的时候也会根据xsd规范对配置进行校验。但是这里需要为你上面xmlns里面配置的mvc、aop、tx等都配置上xsd规范文件。

spring 配置文件的头部 xmls的更多相关文章

  1. 关于spring配置文件的头部编写

    //普通spring配置文件模板1 <?xml version="1.0" encoding="UTF-8" ?> <beans xmlns: ...

  2. 【深入JAVA EE】Spring配置文件解析

    在阅读的过程中有不论什么问题,欢迎一起交流 邮箱:1494713801@qq.com    QQ:1494713801 一.Spring头信息 Spring配置文件的头部信息通常是固定不变的.但每个标 ...

  3. Spring配置文件头及xsd文件版本

    最初Spring配置文件的头部声明如下: Xml代码   <?xml version="1.0" encoding="UTF-8"?> <!D ...

  4. Spring 配置文件头部xmls解析

    <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w ...

  5. Spring配置文件beans.xml头部配置解释

    Spring配置文件beans.xml头部配置解释 - EasonJim - 博客园https://www.cnblogs.com/EasonJim/p/6880329.html

  6. spring配置文件头部配置解析(applicationContext.xml)

    分享一个好的学习网站:http://how2j.cn?p=4509 相信大家对spring的配置文件应该都看的很多了,那么大家对配置文件头部的那一坨坨的东西到底是什么了解吗?下面我就把自己的一些见解和 ...

  7. Spring配置文件中未引入dubbo命名空间头部配置而引起的错误案例

    问题描述: Spring配置文件中未引入dubbo命名空间的头部配置而引起项目启动时报出如下错误信息: org.springframework.beans.factory.xml.XmlBeanDef ...

  8. spring配置文件头部xmlns配置精髓

    <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w ...

  9. 系统启动时,spring配置文件解析失败,报”cvc-elt.1: 找不到元素 'beans' 的声明“异常

    现象:spring加载配置文件applicationContext.xml出错,抛出nested exception is og.xml.sax.SAXParseException; lineNumb ...

随机推荐

  1. Cassandra--JAVA访问Cassandra数据

    JAVA创建Cluster对象 cluster = Cluster.builder() .addContactPoints(contactPoints) .withRetryPolicy(new Lo ...

  2. HotSpot VM GC 的种类

    collector种类 GC在 HotSpot VM 5.0里有四种: incremental (sometimes called train) low pause collector已被废弃,不在介 ...

  3. mino federation 功能

    mino federation 可以让我们进行 bucket的查找,实现更灵活的分布式控制 其中依赖了几个组件 coredns etcd 参考架构图 说明 官方也提供了一个简单的部署的demo,总的来 ...

  4. Compoxure 微服务组合proxy 中间件

    Compoxure 是一个不错的微服务组合中间件,使用此工具我们可以快速的进行micro frontends 应用的开发 使用此工具我们可以替换esi+ ssi 的开发模型(尽管都挺不错). 同时支持 ...

  5. oracle-网络

    e10835 net reference /u01/app/oracle/diag/tnslsnr/oracle1/listener/trace/listener.log TIMESTAMP * CO ...

  6. 从输入URL到页面加载的过程?由一道题完善自己的前端知识体系!

    出处:http://mp.weixin.qq.com/s/qMsf4DcMhn2cf0fXC-PLVA 强缓存与弱缓存 缓存可以简单的划分成两种类型: 强缓存( 200fromcache)与 协商缓存 ...

  7. oauth2 java 代码示例

    @RequestMapping("/oauth") @Controller public class OauthController { String clientId = &qu ...

  8. SpringBoot 项目创建网站

    https://start.spring.io/

  9. 运行Docker镜像

    1. 检查本机Docker镜像 docker images 2. 下载hello-world镜像 docker pull hello-world 3. 运行docker镜像hello-world do ...

  10. Hadoop HDFS 文件块大小

    HDFS 文件块大小 HDFS中的文件在物理上是分块存储(block),块的大小可以通过配置参数( dfs.blocksize)来规定,默认大小在hadoop2.x版本中是128M,老版本中是64M ...