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