zoukankan      html  css  js  c++  java
  • spring beans

    所 有 使 用 XML 文 件 进 行 配 置 信 息 加 载 的 Spring IoC 容 器 , 包 括 BeanFactory 和
    ApplicationContext的所有XML相应实现,都使用统一的XML格式。在Spring 2.0版本之前,这种格
    式由Spring提供的DTD规定,也就是说,所有的Spring容器加载的XML配置文件的头部,都需要以下
    形式的DOCTYPE声明:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" ➥
    "http://www.springframework.org/dtd/spring-beans.dtd">
    <beans>
    ...
    </beans>


    从Spring 2.0版本之后,Spring在继续保持向前兼容的前提下,既可以继续使用DTD方式的DOCTYPE
    进行配置文件格式的限定,又引入了基于XML Schema的文档声明。所以,Spring 2.0之后,同样可以
    使用代码清单4-11所展示的基于XSD的文档声明。

    <beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns:util="http://www.springframework.org/schema/util" 
    xmlns:jee="http://www.springframework.org/schema/jee" 
    xmlns:lang="http://www.springframework.org/schema/lang" 
    xmlns:aop="http://www.springframework.org/schema/aop" 
    xmlns:tx="http://www.springframework.org/schema/tx" 
    xsi:schemaLocation="http://www.springframework.org/schema/beans 
    http://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/context
        http://www.springframework.org/schema/context/spring-context.xsd
        http://www.springframework.org/schema/tx
        http://www.springframework.org/schema/jdbc
        http://www.springframework.org/schema/aop
        http://www.springframework.org/schema/jdbc/spring-jdbc.xsd
        http://www.springframework.org/schema/mvc
        http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd "
    > </beans>



  • 相关阅读:
    Lattice Diamond 的学习之新建工程
    candence 笔记总结
    音乐发生器的原理
    PAL/NTSC 制电视广播技术有关知识--FPGA
    以后绝对不能再犯的错误
    BZOJ1112: [POI2008]砖块Klo
    Luogu P1533 可怜的狗狗
    BZOJ4542: [Hnoi2016]大数
    BZOJ5131: [CodePlus2017年12月]可做题2
    BZOJ3083: 遥远的国度
  • 原文地址:https://www.cnblogs.com/ltflike/p/3991204.html
Copyright © 2011-2022 走看看