일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- 백준
- Python
- 자바
- Spring
- design-pattern
- 프로그래머스
- exception
- JavaScript
- 디자인패턴
- Network
- Java
- 함수형 프로그래밍
- 겨울카카오인턴
- functional programming
- DesignPattern
- Collections
- lambda calculus
- 파이썬
- Eclipse
- 람다 칼큘러스
- javscript
- Rails
- Pattern
- Collection
- solid
- 로버트마틴
- 큐
- JDBC
- tcp
- 스택
Archives
- Today
- Total
개발자 노트
[jsp/el]EL이용한 String Type의 JSONArray parsing. (java) 본문
EL이용한 String Type의 JSONArray parsing. (java)
JSTL을 이용해서 도저히 파싱을 못하겠다.
parisng할 데이터는 [{},{},{}]형태
<%@ page import="org.json.*"%>
<%String jsonString = (String)request.getAttribute("allObjects");
JSONArray ja = new JSONArray(jsonString);
for (int i =0; i<ja.length(); i++){
JSONObject order = ja.getJSONObject(i);
String type = order.getString("type");
if(type.equals("DOING")){ %>
id = <%=order.getLong("id")%><br>
name = <%=order.getString("name")%><br>
regDate = <%=order.getString("regDate")%><br>
sequence = <%=order.getInt("sequence")%><br>
title = <%=order.getString("title")%><br>
type = <%=type %><br>
<br>
<% }%>
<%}%>
반응형
'Web' 카테고리의 다른 글
windowServer에서 ubuntuServer로 옮기기 (0) | 2020.04.22 |
---|---|
[JavaScript]EventBubbling (0) | 2020.04.17 |
[tomcat] eclipse tomcat class not found exception 해결 (0) | 2020.03.23 |
[Tomcat-servlet]Redirect and Forwarding (0) | 2020.03.19 |
[jdbc/mysql]jdbc mysql 연결 방법 (0) | 2020.03.19 |
Comments