Spring的HelloWorld
来源:互联网 发布:电脑网络电视直播软件 编辑:程序博客网 时间:2024/06/03 13:28
Spring的HelloWorld
开发步骤:
1.添加必须的jar包
2.创建普通的Javabean
3.创建并配置Spring的配置文件
4.测试
(一).添加必须的jar包
(二).创建普通的Javabean
(三).创建并配置spring的配置文件
(四).测试
public class TestStudnet{
private ApplicationContext context;
@Before
public void before(){
context=new ClassPathXmlApplocationContext("applicationcontext.xml");
}
@Test
public void test(){Student student= (Student)context.getBean("student");
System.out.println(student);
}
}
注:配置文件中class对应你写的javaben的类具体路径
id可以自己任意取
具体项目实例:
链接:
https://pan.baidu.com/s/1c2yCfeS
密码: u8ht
本人写的小例子,希望对新手有帮助,可以将项目直接导入测试,拿走文件之时还望给个赞
阅读全文
1 0
- Spring的HelloWorld
- Spring 的Helloworld
- spring的HelloWorld<01>
- spring的HelloWorld
- Spring的HelloWorld
- spring的helloworld
- Spring.Net 的简单HelloWorld
- 最简单的Spring HelloWorld
- Spring MVC版本的helloworld
- spring的入门之helloworld
- Spring学习(二):Spring的HelloWorld
- Spring helloworld
- spring helloworld
- spring helloworld
- Spring -- HelloWorld
- spring helloworld
- Spring HelloWorld
- Spring--HelloWorld
- 对于字符串库中,判断给定的字符串,在库中是多少个String的子串。
- Scrapy框架抓取豆瓣电影的小爬虫学习日记(一)
- golang变量
- 扩充你的工具箱
- Java中的StringUtils类
- Spring的HelloWorld
- PCNTL在centos中安装以及多进程更新数据
- Android动态加载热更新修复功能 加载多个dex
- NotePad++使用技巧之宏的使用
- explicit 隐式转换与显示转换
- 从Excle导入到Oracle数据库方法总结
- 前端sublime-text3 这些就够了
- Oracle、Mysql之事务及四大特性
- 将自己的vim打造成IDE