Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/json/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何格式化SpringREST数据json输出_Json_Spring_Rest_Marshalling_Spring Data Rest - Fatal编程技术网

如何格式化SpringREST数据json输出

如何格式化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

我使用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: 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,}]