【皇甫】☀IOC和AOP的拓展实例
2024-10-10 23:47:31
<!--构造器注入 -->
<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>
******************************************************待续
最新文章
- ABP源码分析三十九:ABP.Hangfire
- GitHub项目大全
- 去掉UItableview headerview黏性(sticky)
- PHP 之 FastCGI 与 mod_php 详解
- JMS消息传输机制
- 关于cshtml中的js对动态编译支持的问题
- C++ Dialog Box Command IDs
- VC和VS调用Lua设置以及Lua C API使用。
- 【转】iOS开发UI篇—程序启动原理和UIApplication
- ios delegate 和 block
- JDBC(与Oracle的连接)(转)
- C语言学习第五章
- curl/libcurl获取打开网页平均网速
- Python strip()方法
- centos7 mysql安装
- 「SDOI2014」向量集 解题报告
- 【SpringBoot】常用注解
- cc攻击和ddos攻击的区别和攻防 + 调SYN连接参数
- windows Git Bash 无法运行python解决方法
- windows下的安装及使用 python