笔记1----前台ajax请求,后台返回list对象集合!
来源:互联网 发布:如何下载qq软件 编辑:程序博客网 时间:2024/05/16 00:36
只是小总结,代码还不够优雅,方便自己以后再总结,不废话,上代码。
前台js代码:
function show_resume(resume_id){
$("#p_resume_id").val(resume_id);
$.ajax({
type:"post",
url:contextPath+"/resumefilter/resumeinfo.html",
data:{resume_id:resume_id},
dataType:"json",
success:function(json){
$("#jobname").text(json[0].job_id);
$("#pname").text(json[0].name);
$("#pgender").text(json[0].gender);
$("#pbirthday").text(json[0].birthday);
$("#pnation").text(json[0].nation);
$("#ppolitical").text(json[0].political);
$("#pmarried").text(json[0].married);
$("#pgraduates_chool").text(json[0].graduates_chool);
$("#pprofession").text(json[0].profession);
$("#pgraduateday").text(json[0].graduateday);
$("#pcontact").text(json[0].contact);
$("#porigin").text(json[0].origin);
$("#paccount_location").text(json[0].account_location);
$("#penglish_level").text(json[0].english_level);
$("#pcomputer_level").text(json[0].computer_level);
$("#pidnumber").text(json[0].idnumber);
},
error:function(){
alert("fail");
}
});
后台的java代码:
@RequestMapping(value = "/resumeinfo", method = { RequestMethod.GET,RequestMethod.POST })
public @ResponseBody void resumeinfoAction(HttpServletRequest request,HttpServletResponse response, ModelMap map) {
String resumeid=request.getParameter("resume_id");
List<ResumeFilterQueryVo> list=resumeFilterServiceImpl.getResumeInfo(resumeid);
JSONArray jsonarray=JSONArray.fromObject(list);
try {
response.getWriter().print(jsonarray);
} catch (IOException e) {
e.printStackTrace();
}
}
以后再总结其他的方法。
- 笔记1----前台ajax请求,后台返回list对象集合!
- 将后台List对象以Json格式返回到前台Ajax请求
- SSH JQuery Json ajax请求返回List对象集合
- jquery ajax后台返回list,前台用jquery遍历list
- 前台使用ajax 调用action方法,返回一个对象List集合的json
- ajax从后台返回list类型到前台解析
- 前台jquery+ajax向后台请求数据,后台返回json,前台显示
- 后台返回前台list,前台ajax接收后遍历的方法
- ajax请求数据,后台提供数据返回json, 前台js拼html,回填
- ajax发送请求后台处理数据格式然后返回前台的方法(ObjectMapper)
- extjs和fros框架前台请求,后台通过list集合接收
- 前台Ajax得到后台返回数据
- 前台ajax请求后台实现下载
- 在jquery ajax中,如果从后台往前台传一个List集合,前台解析
- 在jquery ajax中,如果从后台往前台传一个List集合,前台解析
- Jackson 后台将javabean对象、List转为json格式字符串并返回,同时前台解析
- 后台返回json对象,前台取出属性
- ajax请求返回json后台处理
- 欢迎使用CSDN-markdown编辑器
- 趣味i**1/((i-1)**(i-1))
- PostgreSQL学习手册(数据表)
- ubuntu15.10 源码安装 tensorflow
- sql
- 笔记1----前台ajax请求,后台返回list对象集合!
- Android Fastjson解析_id 下划线字段
- Android NDK学习之二. ndk-build使用
- jquery.rotate.js的应用范例
- 数据结构实验之图论二:基于邻接表的广度优先搜索遍历
- ssh远程执行nohup命令不退出
- RPG Maker MV之起始队伍设置
- 基于dubbo框架下的RPC通讯协议性能测试 (顶)
- 用AsyncHttpClient访问xml页面