Spring hello world实例

2024-10-13 04:12:25

1、创建一个Java工程打开 MyEclipse 创建一个java工程:Helloword,敛财醣沁并添加Spring支持类库,右键工程名称,选择"MyEclipse"稆糨孝汶;->"Add Spring Capabilites",如下图:

Spring hello world实例

3、Spring bean 配置文件创建Spring配置文件,并声明所有可用的Springbean。File :applicationContext.xml

Spring hello world实例

5、执行代码

Spring hello world实例
猜你喜欢