📄 springtest.java
字号:
/*******************************************************************
<br>Copyright (C), 2004-2006, yeeku.H.Lee
<br>Program Name:SpringTest.java
<br>Author:yeeku.H.lee kongyeeku@163.com
<br>Version:1.0
<br>This program is protected by copyright laws.
<br>Date: 2005-9-27
*******************************************************************/
package lee;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;
public class SpringTest
{
public static void main(String[] args)
{
ApplicationContext ctx = new FileSystemXmlApplicationContext("bean.xml");
System.out.println("系统获取theAge的值:" + ctx.getBean("theAge"));
System.out.println("系统获取theAge2的值:" + ctx.getBean("theAge2"));
System.out.println("系统获取theAge3的值:" + ctx.getBean("theAge3"));
//System.out.println("系统获取person.age2的值:" + ctx.getBean("person.age2"));
System.out.println("系统获取的son1:" + ctx.getBean("son1"));
System.out.println("系统获取son2的age属性值:" + ((Son)ctx.getBean("son2")).getAge());
System.out.println("系统获取son3的age属性值:" + ((Son)ctx.getBean("son3")).getAge());
System.out.println("系统获取son4的age属性值:" + ((Son)ctx.getBean("son4")).getAge());
System.out.println("系统获取son5的age属性值:" + ((Son)ctx.getBean("son5")).getAge());
System.out.println("系统获取Java版本:" + ctx.getBean("javaVersion"));
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -