<!--构造器注入 -->
<bean id="user1" class="cn.happy.entity.User">
<constructor-arg index="0" type="java.lang.String" value="lxl"></constructor-arg>
<constructor-arg index="1" type="java.lang.String" value="lxl@163.com"></constructor-arg>
</bean>
Test:
ApplicationContext ctx = new ClassPathXmlApplicationContext("applicationContext.xml");
User user=(User)ctx.getBean("user1");
System.out.println(user.getEmail());
<!-- set方法注入 -->
<bean id="user2" class="cn.happy.entity.User">
<!-- 使用property -->
<property name="username" value="张靓颖"></property>
</bean>

******************************************************待续

最新文章

  1. ABP源码分析三十九:ABP.Hangfire
  2. GitHub项目大全
  3. 去掉UItableview headerview黏性(sticky)
  4. PHP 之 FastCGI 与 mod_php 详解
  5. JMS消息传输机制
  6. 关于cshtml中的js对动态编译支持的问题
  7. C++ Dialog Box Command IDs
  8. VC和VS调用Lua设置以及Lua C API使用。
  9. 【转】iOS开发UI篇—程序启动原理和UIApplication
  10. ios delegate 和 block
  11. JDBC(与Oracle的连接)(转)
  12. C语言学习第五章
  13. curl/libcurl获取打开网页平均网速
  14. Python strip()方法
  15. centos7 mysql安装
  16. 「SDOI2014」向量集 解题报告
  17. 【SpringBoot】常用注解
  18. cc攻击和ddos攻击的区别和攻防 + 调SYN连接参数
  19. windows Git Bash 无法运行python解决方法
  20. windows下的安装及使用 python

热门文章

  1. 一个获取指定目录下一定格式的文件名称和文件修改时间并保存为文件的python脚本
  2. 【oracle】oracle表结构导出到Word
  3. C# 读取 CSV 文件
  4. Leetcode Unique Paths II
  5. Hello cnblog!
  6. 存储过程执行失败与sql668n
  7. ZeroMQ接口函数之 :zmq_recvmsg – 从一个socket上接收一个消息帧
  8. Web开发流程
  9. ArcEngine奇怪异常:HRESULT:0x80040351
  10. C++ string