摘要: Spring是什么~春天!哈哈~Spring是一个开源的控制反转(Inversion of Control ,IoC)和面向切面(AOP)的容器框架.它的主要目得是简化企业开发.那好,那到底什么是控制反转呢?先来看一段代码:public class PersonServiceBean { private PersonDao personDao = new PersonDaoBean(); public void save(Person person){ personDao.save(person); }}lPersonDaoBean 是在... 阅读全文
posted @ 2011-12-12 22:22 一直在等 阅读(5792) 评论(0) 推荐(0)
摘要: Struts2为Action中的属性提供了依赖注入功能,在struts2的配置文件中,我们可以很方便地为Action中的属性注入值。注意:属性必须提供setter方法。 1 public class HelloWorldAction{ 2 private String savePath; 3 4 public String getSavePath() { 5 return savePath; 6 } 7 public void setSavePath(String savePath) { 8 this.savePath = sa... 阅读全文
posted @ 2011-12-12 21:54 一直在等 阅读(3143) 评论(0) 推荐(1)