function a(){
$.getJSON("JsonServlet" ,{ "programmers": [
{ "firstName": "Brett", "lastName":"McLaughlin", "email": "[email protected]" },
{ "firstName": "Jason", "lastName":"Hunter", "email": "[email protected]" },
{ "firstName": "Elliotte", "lastName":"Harold", "email": "[email protected]" }
],
"authors": [
{ "firstName": "Isaac", "lastName": "Asimov", "genre": "science fiction" },
{ "firstName": "Tad", "lastName": "Williams", "genre": "fantasy" },
{ "firstName": "Frank", "lastName": "Peretti", "genre": "christian fiction" }
],
"musicians": [
{ "firstName": "Eric", "lastName": "Clapton", "instrument": "guitar" },
{ "firstName": "Sergei", "lastName": "Rachmaninoff", "instrument": "piano" }
]
},function(data){
// alert("data");
});
}请问java后台怎么得到每个数据,谢谢。
$.getJSON("JsonServlet" ,{ "programmers": [
{ "firstName": "Brett", "lastName":"McLaughlin", "email": "[email protected]" },
{ "firstName": "Jason", "lastName":"Hunter", "email": "[email protected]" },
{ "firstName": "Elliotte", "lastName":"Harold", "email": "[email protected]" }
],
"authors": [
{ "firstName": "Isaac", "lastName": "Asimov", "genre": "science fiction" },
{ "firstName": "Tad", "lastName": "Williams", "genre": "fantasy" },
{ "firstName": "Frank", "lastName": "Peretti", "genre": "christian fiction" }
],
"musicians": [
{ "firstName": "Eric", "lastName": "Clapton", "instrument": "guitar" },
{ "firstName": "Sergei", "lastName": "Rachmaninoff", "instrument": "piano" }
]
},function(data){
// alert("data");
});
}请问java后台怎么得到每个数据,谢谢。
解决方案 »
- jsp 获取textare内容不成功,求高手帮助
- jsp socket 问题
- struts2.0 checkbox 赋值问题
- struts2 url标签在 button的onclick中会多一个amp;导致url无效
- 请问servlet的实例是在服务器启动的时候创建还是服务器启动后第一个request请求的时候创建呢?
- 关于多个TOMCAT的问题???(在线等,顶了就有分)
- Structs+myeclipse 实现登陆程序时遇见的问题,急!!!
- 在text框中输入一个字,会代出相关联的数据
- jsp调用dll出现的问题
- 哪位大虾知道哪里有支持jsp的免费主页空间呀?
- 求教关于线程操作jsp的application的问题
- tomcat+ssl配置,坑爹、啊
JSONArray forkData = JSONArray.fromObject(jsonString);
for(int i = 0;i<forkData.size();i++){
forkData.get(i).getXXX()
}