반응형
AjaxTest.html
test.jsp <-- jsonsimple로 만듬
test.html
[
{"name": "lioncat", "age": 14, "nickname": "qwerty"}
]
test.jsp <-- jsonsimple로 만듬
jsonsimple download --> https://code.google.com/p/json-simple/downloads/list
라이브러리 파일은 톰캣 기준으로 WEB-INFO/lib/ 밑에 둔다.
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8" import="org.json.simple.*"%>
<%
String name = request.getParameter("name");
JSONArray jArray = new JSONArray();
JSONObject jObject = new JSONObject();
jObject.put("name", name);
jObject.put("age", "14");
jObject.put("nickname", "qwerty");
jArray.add(0, jObject);
out.println(jArray.toJSONString());
System.out.println(jArray.toJSONString());
%>반응형
'프론트엔드 > Java Script, jQuery, AJAX' 카테고리의 다른 글
| [자바스크립트] 두 날짜간 차이 구하기, 기간구하기 (0) | 2014.07.04 |
|---|---|
| [AJAX] 한글 전송 / 받기 (0) | 2014.01.10 |
| JavaScript: 날짜 Validation 체크 (0) | 2014.01.01 |
| JavaScript 영문, 숫자 체크 (0) | 2013.12.24 |
| JavaScript 유용한 함수 (0) | 2013.12.18 |
WRITTEN BY
,




