jQuery에서 ajax 사용 시, json 처리 방법 (JAVA)
·
Computer/JavaScript
데이터가 배열인 경우.. -- JAVA StringBuffer sb = new StringBuffer(); sb.append("["); for(Iterator it = listVo.iterator(); it.hasNext();) { VO vo = it.next(); sb.append("["); sb.append("'"+vo.getCol1()+"',"); sb.append("'"+vo.getCol2()+"',"); sb.append("'"+vo.getCol3()+"',"); sb.append("'"+vo.getCol4()+"'"); sb.append("]"); if(i++ < size-1) sb.append(","); } sb.append("]"); response.setContentType("text/j..