当前位置: 首页 > news >正文

ui设计师mike个人网站/南京seo公司教程

ui设计师mike个人网站,南京seo公司教程,网站如何做问卷调查问卷,电子产品采购平台1、概念 为bean中的属性注入值,成为数据的装配,可以装配不同类型的值,如int、Map、Boolean等。 2、简单类型(共19种) 八种基本类型及包装类byte short int long double float char booleanByte Short I…

1、概念

为bean中的属性注入值,成为数据的装配,可以装配不同类型的值,如int、Map、Boolean等。

2、简单类型(共19种) 

八种基本类型及包装类byte  short  int   long  double float  char      booleanByte Short Integer Long  Double Float  Character BooleanString Class Resource

简单类型装配值  -- 使用value属性装配

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"><bean id="springBean" class="ioc04.SpringBean"><property name="age" value="13"/><property name="bt" value="22"/><property name="price" value="12.2"/><property name="username" value="tom"/><property name="clazz" value="java.lang.String"/></bean>
</beans>

3、集合类型

数组 List Set Map Properties

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"><bean name="otherBean" class="ioc05.OtherBean"><property name="name" value="tom"/></bean><bean name="springBean" class="ioc05.SpringBean"><!-- 引用IOC容器中另外一个bean  使用ref属性 --><property name="otherBean" ref="otherBean"/><property name="arrays"><!--Array使用array装配--><array><value>1</value><value>2</value><value>4</value></array><!--Array也可以使用List装配--><!--<List><value>1</value><value>2</value><value>4</value></List>--></property><property name="lists"><list><!-- 由于List中放的是OtherBean,所以这里不可以用value属性赋值   因改用ref --><!--使用IOC中已经存在的OtherBean--><ref bean="otherBean"/><!--List中元素可重复--><ref bean="otherBean"/><!-- 重新创建一个新的OtherBean--><bean class="ioc05.OtherBean"><property name="name" value="lokus"/></bean></list></property><property name="sets"><set><!--Set中元素不可重复 如下两个ref引用IOC容器的同一个实例,因此在Set中只会有一个值--><ref bean="otherBean"/><ref bean="otherBean"/><!-- 重新创建一个新的OtherBean--><bean class="ioc05.OtherBean"><property name="name" value="zhangsan"/></bean></set></property><property name="map" ><map><entry key-ref="otherBean" value="java.lang.Integer"/></map></property><property name="properties"><props><!--properties中都是字符串--><prop key="key1">value1</prop></props></property></bean>
</beans>

map集合在装配时有简单类型、引用类型两种方法

4、其他bean的引用

IOC容器要注入的值,是另外一个bean的值 ---->使用ref

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"><bean name="otherBean" class="ioc05.OtherBean"><property name="name" value="tom"/></bean><bean name="springBean" class="ioc05.SpringBean"><!-- 引用IOC容器中另外一个bean  使用ref属性 --><property name="otherBean" ref="otherBean"/></bean>
</beans>

5、NULL类型

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"><bean id="springBean" class="ioc06.SpringBean"><!--将name属性装配成null--><property name="name"><null/></property></bean>
</beans>

 

http://www.jmfq.cn/news/4923325.html

相关文章:

  • 做外贸需要有自己的网站吗/华联股份股票
  • 大连开发区做网站的公司/一份完整的活动策划方案
  • wordpress不能载入图片/沈阳优化网站公司
  • 镇江网站建设哪家好/seo优化需要多少钱
  • 免费建设网站平台/线上网络平台推广
  • wordpress 不显示主题/seoul是韩国哪个城市
  • 购买完域名后怎么做网站/东莞做网站哪家好
  • 个人网站怎么做代码/排名网站
  • 长沙最好网站建设/曼联vs恩波利比分
  • 游戏推广应该怎么推/北京seo网站推广
  • 洛阳有哪些做网站的公司/网络营销的4p策略
  • 优酷的网站头怎么做的/淘客推广怎么做
  • 软件设计师中级/长沙seo网站管理
  • 东莞做网站多少钱/北京seo服务商找行者seo
  • 网站制作的内容包含/亚马逊跨境电商
  • 嘉兴做网站的公司有哪些/360投放广告怎么收费
  • 做财务需要关注哪些网站/关键词林俊杰的寓意
  • 做牙的网站叫什么/武汉seo报价
  • 学生个人网页设计主题/系统优化的意义
  • 机加工如何用网站开发客户/微信crm客户管理系统
  • 网站建设亇金手指专业/宝鸡网站开发公司
  • 海口建设工程信息网站/搜索竞价托管
  • 潍坊市网站建设公司/北京百度seo
  • 二维码创意设计/被公司优化掉是什么意思
  • 网站建设项目的工作分解/seo软件推广
  • vps 网站发布/长沙建站seo公司
  • 如何对网站进行推广/新闻稿件代发平台
  • 济南网站开发企业/如何进行关键词分析
  • 沧州哪里可以做网站/免费域名注册永久
  • 湖南人文科技学院宿舍/网站优化策略分析论文