简单的参数注入
来源:互联网 发布:员工网络 访客网络 编辑:程序博客网 时间:2024/05/16 14:47
public class StudentService {private String name;private int age;public String getName() {return name;}public void setName(String name) {this.name = name;}public int getAge() {return age;}public void setAge(int age) {this.age = age;}public void show(){System.out.println("name:"+name+" age:"+age);}}
<?xml version="1.0" encoding="UTF-8"?><beansxmlns="http://www.springframework.org/schema/beans"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:p="http://www.springframework.org/schema/p"xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd"><bean id="S_service" class="com.sl.service.StudentService"><property name="name" value="xiao hong"></property><property name="age"><value>18</value></property></bean></beans>
public class test {@Testpublic void testOne(){ApplicationContext appl=new ClassPathXmlApplicationContext("beans_2.xml");StudentService service=(StudentService)appl.getBean("S_service");service.show();}}
- 简单的参数注入
- 不同类型参数的注入
- 简单的故障注入
- 简单的DLL注入
- Spring的简单注入
- 简单的sql注入
- 注入的几个小参数
- 依赖注入的参数详解
- 一个简单的oracle注入
- 一个简单的MongoDB注入
- 简单的数据库注入技术
- 一个简单的SQL注入
- phpSQL注入的简单解决办法
- 简单的sql注入,安全第一
- 简单的模拟依赖注入
- Android简单的View注入
- 简单的SQL注入攻击
- 依赖注入的简单理解
- Iterator与ListIterator有什么区别?
- 传智播客成都java培训中心2月25日就业班新开班
- 创建守护进程
- ARGB和PARGB
- 软件测试用例的有效性分析及评估方法
- 简单的参数注入
- linux c 生成 bitmap
- sa登陆失败 SQL Server错误18456的解决方法
- 如何巧妙回答离职原因
- [跳槽|跳槽准备]跳槽 请系好安全带
- 实现一个可限制最大连接数的Proactor服务器
- ios 关于 通过加载 xib 生成的view,调用 addsubviews,sub view的按钮 不相应点击事件的 问题
- python django 快速搭建开发平台
- Dom4j的使用