导航

<2006年7月>
2526272829301
2345678
9101112131415
16171819202122
23242526272829
303112345
统计
  • 随笔 - 37
  • 文章 - 1
  • 评论 - 39
  • 引用 - 0

常用链接

留言簿(2)

随笔分类(25)

随笔档案(37)

文章档案(1)

相册

收藏夹(1)

代码

搜索

  •  

积分与排名

  • 积分 - 44839
  • 排名 - 1072

最新评论

阅读排行榜

评论排行榜

 
1。ServiceLocator 中一般包含static方法
2。ServiceLocator角色  如果让TopBaseAction承担(可以非静态,也很方便)
3。ServiceLocator的角色和SessionFactory有些类似(都是用工厂模式)

10月5日,今天玩了一下把 Service层的实力注入到Action里面,我的ServiceLocator类也终于可以睡觉去了.
posted on 2006-07-10 14:53 pear 阅读(418) 评论(1)  编辑  收藏 所属分类: 心得体会
Comments
  • # re: ServiceLocator 中一般包含static方法
    pear
    Posted @ 2006-10-05 14:24
    三种情况的getBean()呵呵,可以不写了.
    ApplicationContext context = WebApplicationContextUtils.getWebApplicationContext(servletContext);
    ProductService productService = (ProductService) context.getBean("myProductService");
    ApplicationContext context =
    new FileSystemXmlApplicationContext("C:/myContext.xml");
    ProductService productService =
    (ProductService) context.getBean("myProductService");
    ApplicationContext context =
    new ClassPathXmlApplicationContext("myContext.xml");
    ProductService productService =
    (ProductService) context.getBean("myProductService");  回复  更多评论   

只有注册用户登录后才能发表评论。


网站导航: