jquery为下拉框添加option(3)
来源:未知 责任编辑:责任编辑 发表时间:2015-03-01 01:36 点击:次
response.setContentType("application/json;charset=gbk");
response.setCharacterEncoding("gbk");
PrintWriter pw = response.getWriter();
pw.write(JSONUtils.valueToString(json));
pw.flush();
}
return null;
}
public void setLoginService(LoginService loginService) {
this.loginService = loginService;
}
public static void main(String[] args) {
String testStr =
"{ \"employees\":[{\"user_id\": 841 , \"user_name\":\"EnidChen\"},{\"user_id\": \"1445\" , \"user_name\":\"JulieZhu\"},{\"user_id\": \"1447\" , \"user_name\":\"JasonMa\"}]}";
www.2cto.com
System.out.println(testStr);
Map json = (Map) JSONSerializer.toJSON(testStr);
List employees = (List) json.get("employees");
System.out.println(employees.size());
Map json2 = (Map) JSONSerializer.toJSON(employees.get(0));
System.out.println(json2.get("user_id"));
System.out.println(json2.get("user_name"));
}
}
摘自 xinghui_liu的专栏
相关新闻>>
- 发表评论
-
- 最新评论 更多>>