Jquery Ajax 返回值传送到前台
Jquery Ajax 返回值传递到前台
var callbackMsg ; $.ajax({ type:"GET", url:'<%=request.getContextPath()%>/tagServletMaintain/'+msg+'?_method=getRelated', async :false, success:function(data){ callbackMsg="已有 "+data+" 篇资讯使用选中的标签,是否继续删除?"; } });
后台JAVA代码
public void renderGetRelated(RenderContext context, String ids) throws Exception { PrintWriter pwriter = this.getHttpServletResponse(context).getWriter(); pwriter.print(tagService.getRelated(ids)); pwriter.close(); }