Notice
Recent Posts
Recent Comments
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- gwt-ext
- spring jpa
- spring security
- ibatis
- jquery
- spring transaction
- JBoss Seam
- SVN
- Hudson
- bootstrap jquery datepicker
- maven
- Spring
- zabbix
- drools
- jquery serialize
- COC
- GEventEvaluator
- jstl
- java tip
- guvnor
- JPA
- MySQL
- @SqlResultSetMapping
- querydsl
- rember me
- CEP
- jenkins
- Drools Fusion
- gwt
- custom filter
Archives
- Today
- Total
봉 블로그
JsonPath 소개 본문
Spring 3.2 부터는 Spring MVC의 JUNIT Test 를 위한 좀더 유연한 API 를 제공하는데
이를 이용하면 API 서버의 통합테스트를 서버배포 없이 시나리오기준으로 쉽고 빠르게 진행할수 있다. JUNIT 만으로..ㅎ
그러다 알게된 JsonPath.
JsonPath 는 XPath 처럼 JSON 데이타를 처리하기 위한 쉬운 표현식을 제공한다.
javascript, php, java 에서 사용할수 있는 라이브러리가 있다.
참고: http://goessner.net/articles/JsonPath/
아래에서 java 에서 사용할수 있는 라이브러리를 다운받을수 있다. 간략한 사용방법도 소개하고 있다.
https://github.com/jayway/JsonPath
maven depency 설정
아래에서 JsonPath 를 당장 테스트해볼수 있다.
http://jsonpath.herokuapp.com/
example:
author 가 'Evelyn Waugh' 인 book 검색 : $..book[?(@.author == 'Evelyn Waugh')]
book list 2 ~ 4 까지 slice : $..book[2:4]
마지막 book : $..book[(@.length-1)]