自由的天空

          簡單通用

            BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理 ::
            12 隨筆 :: 6 文章 :: 9 評論 :: 0 Trackbacks

                最近已經把ecside2.0放置到正式的開發項目中,感覺效率還可以,鑒于fins最近比較忙,一直沒有提供一個struts方面的CRUD的完整DEMO,通過上次和FINS的交流提供一個暫時解決的辦法,也發現ecside在處理事務方面的一個問題,不過fins說在下幾個版本中解決.
                把相關的代碼帖在這里:
               /**
            * 修改用戶
            * @param mapping
            * @param form
            * @param request
            * @param response
            * @return
            * @throws Exception
            */
           public ActionForward update(ActionMapping mapping, ActionForm form,
             HttpServletRequest request, HttpServletResponse response)
             throws Exception {
            OperationTypeService service = new OperationTypeServiceImpl();// 服務操作
            OperationType bean = new OperationType();
            com.skywing.util.request.RequestUtil.populate(bean, request);
            bean.setOid(request.getParameter(TableConstants.RECORDKEY_NAME));
            bean.setCreator("創建者");
            bean.setCreatetime(com.skywing.util.db.string.StringUtil.getToday());
            try {
             service.update(bean);

            } catch (Exception ex) {
             ex.printStackTrace();
            }

            String id = request.getParameter(TableConstants.RECORDKEY_NAME);  //關鍵點在這里
            ServletUtil.writeDefaultTextToClient(id, RequestUtil.successfulInfo(request), null, request, response);///////////////////////////////////
            return null;
           }    

          然后修改 org.ecside.util下的ServletUtil類  /** 如果沒有這個方法就添加這個方法
               *
               * @param recordKey  記錄的標題
               * @param code  //返回的代碼 // code = RequestUtil.successfulInfo(request) or RequestUtil.failedInfo(request);
               * @param message  //返回的信息
               * @param request
               * @param response
               * @throws ServletException
               * @throws IOException
               */
           public static void writeDefaultTextToClient(String recordKey, String code,
             String message, HttpServletRequest request,
             HttpServletResponse response) throws ServletException, IOException {
            response.setContentType("text/html");
            PrintWriter out = response.getWriter();
            out.flush();
            out.println(code);
            out.println(recordKey);
            out.print(message);
            out.flush();
            out.close();
           }

          還有fins真的應該想想怎么做版本控制了,版本的變遷比較大,需要保持一定的連續性

          posted on 2007-05-27 15:45 李志峰 閱讀(1859) 評論(2)  編輯  收藏 所屬分類: 代碼天地

          評論

          # re: ECSIDE2.0beta版本中關STRUTS提交中正在提交解決暫時解決辦法! 2007-10-26 14:56 zhanghui
          webwork+ecside 3.0版點分頁或刷新 出現"正在提交"不知道這個問題有沒有解決 正在關注...  回復  更多評論
            

          # re: ECSIDE2.0beta版本中關STRUTS提交中正在提交解決暫時解決辦法! 2008-06-18 11:21 倚樓
          樓上的 可以試一下把 useAjax ="false"
            回復  更多評論
            

          主站蜘蛛池模板: 大田县| 宁明县| 贵德县| 临泽县| 林甸县| 穆棱市| 科技| 蕉岭县| 城固县| 通渭县| 安溪县| 临沂市| 天峻县| 故城县| 黄石市| 青海省| 通州区| 桦甸市| 浦东新区| 县级市| 江川县| 陕西省| 梁河县| 中西区| 仲巴县| 巴青县| 道孚县| 淅川县| 司法| 铜梁县| 金湖县| 夹江县| 临邑县| 柳林县| 镇雄县| 西藏| 荆门市| 荔波县| 时尚| 莒南县| 应城市|