일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
Tags
- phonegap
- sencha touch
- jsr 296
- PLSQL
- rowspan
- Google Map
- jQuery
- MySQL
- Ajax
- Android
- JDOM
- ibsheet
- Eclipse
- PHP
- tomcat
- 가우스
- oracle
- appspresso
- 전자정부프레임워크
- Struts
- MFC
- swingx
- 선택적조인
- JSON
- node.js
- WebLogic
- Spring
- dock
- GPS
- iBATIS
Archives
- Today
- Total
Where The Streets Have No Name
json example - 서버에서 받아오는것 본문
req.setCharacterEncoding("utf-8");
LBox reqBox = LCollectionUtility.getBox(req);
GetEmpListTask task = new GetEmpListTask(reqBox.get("user_name"));
//xmlhttp로 받을시 utf-8지정해야 한글이 안깨짐
res.setContentType("text/html;charset=UTF-8");
try{
task.perform();
List empList = task.getList();
PrintWriter out = res.getWriter();
JSONArray jsonArray = JSONArray.fromArray( empList.toArray() );
out.println(jsonArray);
out.close();
}catch(SysException se){
res.sendError(-1,se.getMessage());
throw se;
}
return null;
clien단
var tmp = eval(originalRequest.responseText);
alert(tmp.length);
alert(tmp[0].userName); //value object의 멤버변수로 접근
LBox reqBox = LCollectionUtility.getBox(req);
GetEmpListTask task = new GetEmpListTask(reqBox.get("user_name"));
//xmlhttp로 받을시 utf-8지정해야 한글이 안깨짐
res.setContentType("text/html;charset=UTF-8");
try{
task.perform();
List empList = task.getList();
PrintWriter out = res.getWriter();
JSONArray jsonArray = JSONArray.fromArray( empList.toArray() );
out.println(jsonArray);
out.close();
}catch(SysException se){
res.sendError(-1,se.getMessage());
throw se;
}
return null;
clien단
var tmp = eval(originalRequest.responseText);
alert(tmp.length);
alert(tmp[0].userName); //value object의 멤버변수로 접근