[{"sDepartmentId":"006","sCarType":"C","iPlanNumber":"0"},{"sDepartmentId":"006","sCarType":"P","iPlanNumber":"0"},{"sDepartmentId":"006","sCarType":"N","iPlanNumber":"0"},{"sDepartmentId":"006","sCarType":"G","iPlanNumber":"0"},{"sDepartmentId":"006","sCarType":"T","iPlanNumber":"0"},{"sDepartmentId":"007","sCarType":"C","iPlanNumber":"0"},{"sDepartmentId":"007","sCarType":"P","iPlanNumber":"0"},{"sDepartmentId":"007","sCarType":"N","iPlanNumber":"0"},{"sDepartmentId":"007","sCarType":"G","iPlanNumber":"0"},{"sDepartmentId":"007","sCarType":"T","iPlanNumber":"0"},{"sDepartmentId":"004","sCarType":"C","iPlanNumber":"0"},{"sDepartmentId":"004","sCarType":"P","iPlanNumber":"0"},{"sDepartmentId":"004","sCarType":"N","iPlanNumber":"0"},{"sDepartmentId":"004","sCarType":"G","iPlanNumber":"0"},{"sDepartmentId":"004","sCarType":"T","iPlanNumber":"0"},{"sDepartmentId":"005","sCarType":"C","iPlanNumber":"0"},{"sDepartmentId":"005","sCarType":"P","iPlanNumber":"0"},{"sDepartmentId":"005","sCarType":"N","iPlanNumber":"0"},{"sDepartmentId":"005","sCarType":"G","iPlanNumber":"0"},{"sDepartmentId":"005","sCarType":"T","iPlanNumber":"0"}]这样的,我在后台改怎样会的啊!求高手帮助一下,谢谢!
如果要冲界面上要传到后台的话可以先将json对象转换成js对象(用evalJSON()方法可以转),然后当做参数传回来,action中就用request.getParameter()方法就能拿到了,不过看楼主的格式传过来的对象是一个数组,要拿到具体的值要用下标来那,比如你在action用一个objs去getParament这个传过来的对象的话,要拿到相应的第一行的值要这样:objs[0].sDepartmentId 拿到的值便是第一行的006,自己去试一下!嘿嘿
没有唯一标识符吗??你的数据 $.post( "<%=basePath%>/chg", //url {newpwd:$("#newpwd2").val()}, //参数 function(data){ $("#sp").html(data); //回调函数 }, "html" ); String newpwd=request.getParameter("newpwd"); //获得新密码