日期:2014-05-17 浏览次数:20721 次
var params="method="+"<%=method%>&fields="+fieldValue; $.ajax({ type: "POST", url: "../../xtgl/wfm/ApplyServlet.do", dataType :"xml", data: params, success: doBack , error: function(msg){ alert("执行有误!"); } });
String fields=AmsFunction.ObjToStr(req.getParameter("fields")); String message ="操作失败"; try { String sql="update T_Rmase set C_STATE='0' where id in ("+fields+")"; logger.info(sql); int i = dao.executeUpdate(sql, null); logger.info(i); message ="操作成功"; } catch (SQLException e) { return ; } res.setContentType("text/xml"); res.setCharacterEncoding("UTF-8"); Document doc=DocumentHelper.createDocument(); Element root=doc.addElement("xml"); PrintWriter out=null; try { out=res.getWriter(); out.flush(); } catch (IOException e) { e.printStackTrace(); } root.addAttribute("message", message); root.addAttribute("type", "includeRmase"); OutputFormat format = new OutputFormat(); format.setEncoding("UTF-8"); XMLWriter writer = new XMLWriter(out, format); try { writer.write(doc); writer.close(); } catch (IOException e) { e.printStackTrace(); }finally{ out.close(); }