如何格式化SpringREST数据json输出
我使用SpringDataREST从AmazonDynamodb读取记录。除了输出格式外,该服务工作正常 我从服务中看到的输出是-如何格式化SpringREST数据json输出,json,spring,rest,marshalling,spring-data-rest,Json,Spring,Rest,Marshalling,Spring Data Rest,我使用SpringDataREST从AmazonDynamodb读取记录。除了输出格式外,该服务工作正常 我从服务中看到的输出是- ---> HTTP GET ---> END HTTP (no body) <--- HTTP 200 (1082ms) : HTTP/1.1 200 OK Transfer-Encoding: chunked Content-Type: application/hal+json X-Application-Context: applicati
---> HTTP GET
---> END HTTP (no body)
<--- HTTP 200 (1082ms)
: HTTP/1.1 200 OK
Transfer-Encoding: chunked
Content-Type: application/hal+json
X-Application-Context: application
Server: Jetty(8.1.14.v20131031)
{"_links":{"search":{"href":"something"}},"_embedded":{"userInfoes":[{"id":"bde0ef42-30c2-4ccd-8b0f-44d718827f69","username":"dsds","password":"1234","highestscore":99,"_links":{"self":{"href":"something"}}}]}}
<--- END HTTP (291-byte body)
您应该能够使用Jackson库将数据整理成一个对象,然后取出您需要的:
[{"id":"bde0ef42-30c2-4ccd-8b0f-44d718827f69","username":"dsds","password":"1234","highestscore":99,}]