<?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:c="http://www.springframework.org/schema/c"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:jdbc="http://www.springframework.org/schema/jdbc"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-4.3.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.3.xsd
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-4.3.xsd"> <bean id = "dog" class = "com.cc8w.Entity.Dog">
<constructor-arg>
<value>旺财</value>
</constructor-arg>
<constructor-arg>
<value>20</value>
</constructor-arg>
<constructor-arg>
<value>雄性</value>
</constructor-arg>
</bean>
<!-- 自动寻找类 -->
<context:component-scan base-package="com.cc8w.Mvc"></context:component-scan> <bean id = "car" class = "com.cc8w.Mvc.Car">
<property name="type" value = "auto"></property>
<property name="price" value = "1000000"></property>
</bean>
<!-- 自动类中引用别的外部类 -->
<bean id = "persion" class = "com.cc8w.Mvc.Persion">
<property name="names" value = "lees"></property>
<property name="age" value = "13"></property>
<property name="cars" ref = "car"></property> </bean> </beans>

特殊字符用<![CDATA[]]>包含

Spring中xml文件配置也可以配置容器list、set、map的更多相关文章

  1. MyEclipse/Eclipse中XML文件的格式化配置

    Eclipse中XML文件的格式化配置 MyEclipse: 这一步的配置是使格式化的效果为控件的每个属性配置占一行.进入 Window/Preferences,展开到 XML/XML Resourc ...

  2. Java Web的web.xml文件作用及基本配置(转)

    其实web.xml就是asp.net的web.config一个道理. 说明: 一个web中完全可以没有web.xml文件,也就是说,web.xml文件并不是web工程必须的. web.xml文件是用来 ...

  3. 【转载】Java Web的web.xml文件作用及基本配置

    其实web.xml就是asp.net的web.config一个道理. 说明: 一个web中完全可以没有web.xml文件,也就是说,web.xml文件并不是web工程必须的. web.xml文件是用来 ...

  4. 51. spring boot属性文件之多环境配置【从零开始学Spring Boot】

    原本这个章节是要介绍<log4j多环境不同日志级别的控制的>但是没有这篇文章做基础的话,学习起来还是有点难度的,所以我们先一起了解下spring boot属性文件之多环境配置,当然文章中也 ...

  5. 曹工说Spring Boot源码(17)-- Spring从xml文件里到底得到了什么(aop:config完整解析【中】)

    写在前面的话 相关背景及资源: 曹工说Spring Boot源码(1)-- Bean Definition到底是什么,附spring思维导图分享 曹工说Spring Boot源码(2)-- Bean ...

  6. ideal中spring的xml文件没有提示的问题

    ideal中spring的xml文件没有提示的问题 今天第一次用ideal来练习spring,发现和视频中老师不一样,我的没有提示.老师的视频里,他写了个<mvc:a   就会有一系列的提示,然 ...

  7. Spring AOP:面向切面编程,AspectJ,是基于spring 的xml文件的方法

    导包等不在赘述: 建立一个接口:ArithmeticCalculator,没有实例化的方法: package com.atguigu.spring.aop.impl.panpan; public in ...

  8. 曹工说Spring Boot源码(7)-- Spring解析xml文件,到底从中得到了什么(上)

    写在前面的话 相关背景及资源: 曹工说Spring Boot源码(1)-- Bean Definition到底是什么,附spring思维导图分享 曹工说Spring Boot源码(2)-- Bean ...

  9. 曹工说Spring Boot源码(8)-- Spring解析xml文件,到底从中得到了什么(util命名空间)

    写在前面的话 相关背景及资源: 曹工说Spring Boot源码(1)-- Bean Definition到底是什么,附spring思维导图分享 曹工说Spring Boot源码(2)-- Bean ...

随机推荐

  1. IOS学习笔记44--ASIRequestHttp之BUG(一)

    其实这也是无意间看到的,大家看看是不是这么回事 BUG:当下载线程数超过2时,就会影响到主线程响应用户请求的速度了 看ASIRequestHttp.m--requestFinished代码 - (vo ...

  2. iOS \U7ea2 乱码 转换

    通常网络请求的数据,如果不做处理在输出时显示是 \U 之类的编码的: 不需要导入别的类库解决方法 - (NSString *)replaceUnicode:(NSString *)unicodeStr ...

  3. php之快速入门学习-1

    貌似和JSP差不多! PHP 脚本可以放在文档中的任何位置. PHP 脚本以 <?php 开始,以 ?> 结束: <?php// PHP 代码?> PHP 文件的默认文件扩展名 ...

  4. Java从零开始学三(public class和class)

    使用public class和class声明的区别 public class文件名称必须与类名称一致 class文件名称可以与类名称不一致  

  5. request.getSession().setAttribute(&quot;&quot;,..)和request.setAttribute(&quot;&quot;,...)的差别

    request.getSession.setAttribute()是获得当前会话的session,然后再setAttribute到session里面去,有效范围是session而不是request. ...

  6. JDK核心JAVA源代码解析(1) - Object

    想写这个系列非常久了,对自己也是个总结与提高.原来在学JAVA时.那些JAVA入门书籍会告诉你一些规律还有法则,可是用的时候我们一般非常难想起来,由于我们用的少而且不知道为什么.知其所以然方能印象深刻 ...

  7. Windows10关闭SearchUI.exe进程的方法

    目前唯一的方法只能通过修改Cortana目录的方法来禁止Cortana 路径:C:\Windows\SystemApps\Microsoft.Windows.Cortana_***

  8. 安装 启动sshd服务:

    .先确认是否已安装ssh服务: [root@localhost ~]# rpm -qa | grep openssh-server openssh-server-.3p1-.fc12.i686 (这行 ...

  9. ios8.1.3Cydia重装

    1.下载deb包 2.把包放到/var/mobile/Media/下 3.终端输入:dpkg -i /var/mobile/Media/*.deb 然后输入:su -c uicache mobile ...

  10. Linux/shell命令的实际应用——查看Port占用 netstat

    启动1024端口一下,是需要root权限的 该Linux/shell命令主要用于解决: 1.查看某端口是否被占用: 2.查看某端口被哪个进程占用: 3.查看某个进程占用了哪些端口: 比如我tomcat ...