일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- JDOM
- Eclipse
- jQuery
- swingx
- Android
- ibsheet
- Spring
- PLSQL
- 전자정부프레임워크
- node.js
- tomcat
- jsr 296
- PHP
- Ajax
- JSON
- Google Map
- MFC
- phonegap
- WebLogic
- oracle
- 선택적조인
- 가우스
- dock
- GPS
- iBATIS
- Struts
- rowspan
- MySQL
- sencha touch
- appspresso
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의 멤버변수로 접근