自由的天空

          簡單通用

            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"
            回復  更多評論
            

          主站蜘蛛池模板: 龙岩市| 大邑县| 恩平市| 河西区| 通州区| 米易县| 科技| 平湖市| 丰都县| 易门县| 辽中县| 庆安县| 诏安县| 桓台县| 武夷山市| 陕西省| 同仁县| 班戈县| 吴川市| 潼南县| 巴南区| 旌德县| 突泉县| 定结县| 岳阳县| 河津市| 甘谷县| 平武县| 阿尔山市| 岳池县| 集安市| 江永县| 红桥区| 寿光市| 六枝特区| 平乡县| 宜阳县| 芦山县| 眉山市| 湟源县| 迁西县|