1。ServiceLocator 中一般包含static方法
          2。ServiceLocator角色 ?如果讓TopBaseAction承擔(可以非靜態,也很方便)
          3。ServiceLocator的角色和SessionFactory有些類似(都是用工廠模式)

          10月5日,今天玩了一下把 Service層的實力注入到Action里面,我的ServiceLocator類也終于可以睡覺去了.
          posted on 2006-07-10 14:53 pear 閱讀(421) 評論(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");  回復  更多評論   
           
          主站蜘蛛池模板: 武夷山市| 萨迦县| 墨玉县| 永丰县| 阜宁县| 平度市| 宁国市| 通山县| 罗定市| 鄱阳县| 乌拉特前旗| 汕头市| 五大连池市| 兴化市| 鹰潭市| 沧州市| 高台县| 武鸣县| 岱山县| 手游| 安宁市| 微山县| 锡林郭勒盟| 日喀则市| 纳雍县| 抚顺市| 金阳县| 榆社县| 湖口县| 剑川县| 房山区| 漳浦县| 安仁县| 屯留县| 集贤县| 宁陵县| 罗山县| 靖安县| 大悟县| 丰城市| 安达市|