加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

《Pro Spring》学习笔记之依赖检查

发布时间:2020-12-13 20:39:11 所属栏目:百科 来源:网络整理
导读:? xmlversion="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/beanshttp://www.springframewo
<? xmlversion="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/beanshttp://www.springframework.org/schema/beans/spring-beans-2.0.xsd" >
<!-- 简单检查,只检查bean的简单属性,如studentbean的stuName属性是否进行注入,如果设置成objects,则检查其依赖属性stuCourse的couseName是否注入
如设置成all,则同时检查simple和objects的检查内容
-->
< bean id ="student" class ="ch4_Check.Student" dependency-check ="simple" >
< property name ="stuName" >
< value > gaoxiang </ value >
</ property >
< property name ="stuCourse" >
< ref bean ="stuCourse" />
</ property >
</ bean >


< bean id ="course" name ="stuCourse" class ="ch4_Check.Course" >
< property name ="courseName" >
< value > shuxu </ value >
</ property >
</ bean >
</ beans >

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读