首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > JavaScript >

在增添和编辑的时候,从后台的响应判断是否成功的JS写法

2012-09-08 
在添加和编辑的时候,从后台的响应判断是否成功的JS写法前台的逻辑判断/*** @since SPC800* @throws Except

在添加和编辑的时候,从后台的响应判断是否成功的JS写法
前台的逻辑判断

    /**      * @since SPC800     * @throws Exception     *             Exception     * @param mapping     *            mapping     * @param form     *            form     * @param request     *            request     * @param response     * 此方法为用户在点击查询按钮的时候调用的Ajax验证方法,如果没有数据则不允许open window     */    @SuppressWarnings("unchecked")    public ActionForward verifySoftwareList(ActionMapping mapping,        ActionForm form, HttpServletRequest request,        HttpServletResponse response) throws Exception    {        HttpSession session = request.getSession(false);        PrintWriter out = response.getWriter();        //语种        String nls = (String) session.getAttribute(SupportConstants.CFG_NLS);        //界面上获取订单号        String pno = request.getParameter("pno").trim();        //界面上获取合同号        String cno = request.getParameter("cno").trim();                JSONObject jsonObj = new JSONObject();        jsonObj.put(PoApplyConstants.NLS_LANG, nls);        jsonObj.put(PoApplyConstants.CONTRACT_NO, cno);        jsonObj.put(PoApplyConstants.PO_NO, pno);        jsonObj.put(PoApplyConstants.IFSELECTED, "VERIFY");        //调用WebService的后台接口        IPoApplyWs poApplyWs = new IPoApplyWsProxy();        String resultStr =            poApplyWs.getRelatedSwDetailListById(jsonObj.toString());        String str = "";        if (null != resultStr && !"0".equals(resultStr))        {            //"OK "            str  = "{"reslut":"OK"}";            out.write(str);            //out.write("OK");        }        else        {            str  = "{"reslut":"FAILED"}";            out.write(str);                      //  out.write("FAILED");        }        return null;    }






热点排行