function doCheck(roomId,userEname,status,i){ $.post("${ctx}/admin/user/docheck",{roomId:roomId,userEname:userEname,status:status,i:i},function(data){ var oTxt=jQuery.parseJSON(data); alert(oTxt.msg); if(oTxt.flag=="T") $("#check"+i).hide(); }); }
后台JAVA:
public @ResponseBody String approveUser(HttpServletRequest request,HttpServletResponse response,@RequestParam(value="id") String id,@RequestParam(value="roomId") String roomId){ JSONObject json=new JSONObject(); try{ roomUserManager.modfiy(id,roomId); json.put("flag","T"); json.put("msg","审核通过"); }catch(Exception ex){ json.put("flag","F"); json.put("msg","操作异常"); } showJson(json,response); }
protected String showJson(JSONObject jvo,HttpServletResponse response){ try { response.setContentType("text/html;charset=UTF-8"); PrintWriter out = response.getWriter(); out.print(jvo.toString()); } catch (Exception e) { e.printstacktrace(); } return null; }
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。