コード例 #1
0
 public ActionForward tree_saveOrUpdate(
     ActionMapping mapping,
     ActionForm form,
     HttpServletRequest request,
     HttpServletResponse response)
     throws Exception {
   PrintWriter out = response.getWriter();
   Response res = new Response();
   try {
     Long id = Long.parseLong(request.getParameter("id"));
     Long pid = Long.parseLong(request.getParameter("pid"));
     String name = request.getParameter("name");
     Integer orderNo = Integer.parseInt(request.getParameter("orderNo"));
     service.tree_saveOrUpdate(id, pid, name, orderNo);
     res.setSuccess(true);
   } catch (Exception e) {
     res.setSuccess(false);
     e.printStackTrace();
     Logger.getRootLogger().error(e.getMessage());
   } finally {
     out.println(JSONObject.fromObject(res).toString());
     out.close();
   }
   return null;
 }
コード例 #2
0
 public ActionForward MemberGroup_findAll(
     ActionMapping mapping,
     ActionForm form,
     HttpServletRequest request,
     HttpServletResponse response)
     throws Exception {
   PrintWriter out = response.getWriter();
   Response res = new Response();
   try {
     res.setData(service.MemberGroup_findAll().toString());
     res.setSuccess(true);
   } catch (Exception e) {
     res.setSuccess(false);
     e.printStackTrace();
     Logger.getRootLogger().error(e.getMessage());
   } finally {
     out.println(JSONObject.fromObject(res).toString());
     out.close();
   }
   return null;
 }
コード例 #3
0
 public ActionForward td_saveOrUpdate(
     ActionMapping mapping,
     ActionForm form,
     HttpServletRequest request,
     HttpServletResponse response)
     throws Exception {
   PrintWriter out = response.getWriter();
   Response res = new Response();
   try {
     String data = request.getParameter("data");
     service.td_saveOrUpdate(JSONObject.fromObject(data));
     res.setSuccess(true);
   } catch (Exception e) {
     res.setSuccess(false);
     e.printStackTrace();
     Logger.getRootLogger().error(e.getMessage());
   } finally {
     out.println(JSONObject.fromObject(res).toString());
     out.close();
   }
   return null;
 }
コード例 #4
0
 public ActionForward content_delete(
     ActionMapping mapping,
     ActionForm form,
     HttpServletRequest request,
     HttpServletResponse response)
     throws Exception {
   PrintWriter out = response.getWriter();
   Response res = new Response();
   try {
     Long id = Long.parseLong(request.getParameter("id"));
     service.content_delete(id);
     res.setSuccess(true);
   } catch (Exception e) {
     res.setSuccess(false);
     e.printStackTrace();
     Logger.getRootLogger().error(e.getMessage());
   } finally {
     out.println(JSONObject.fromObject(res).toString());
     out.close();
   }
   return null;
 }
コード例 #5
0
 public ActionForward treeFld_saveOrUpdate(
     ActionMapping mapping,
     ActionForm form,
     HttpServletRequest request,
     HttpServletResponse response)
     throws Exception {
   PrintWriter out = response.getWriter();
   Response res = new Response();
   try {
     JSONArray array = JSONArray.fromObject(request.getParameter("data"));
     for (int i = 0, len = array.size(); i < len; i++) {
       service.treeFld_saveOrUpdate(array.getJSONObject(i));
     }
     res.setSuccess(true);
   } catch (Exception e) {
     res.setSuccess(false);
     e.printStackTrace();
     Logger.getRootLogger().error(e.getMessage());
   } finally {
     out.println(JSONObject.fromObject(res).toString());
     out.close();
   }
   return null;
 }