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