--JAVA 부분
@RequestMapping(value="/financeList", method=RequestMethod.GET)
public String financeList(ModelMap modelMap){
JSONObject obj = new JSONObject();
obj.put("Test", "New");
obj.put("Test1", "New1");
JSONArray arr = new JSONArray();
arr.put(12);
arr.put(122);
arr.put(453);
arr.put(123);
obj.put("NumberList", arr);
System.out.println(obj.toString());
modelMap.put("json", obj.toString());
return "jsonTest";
}
--JSP 부분
<jsp:directive.page contentType="text/html;charset=UTF-8" />${json}
댓글 없음:
댓글 쓰기