【发布时间】:2019-08-10 20:16:55
【问题描述】:
我能够从网站提取数据并得到响应
{"vulnerability":{"id":15017916,"status":"open","closed_at":null,"created_at":"2019-07-26T10:06:03Z","due_date":null,"notes":null,"port":[],"priority":null,"identifiers":["adobe-flash-apsb14-21-cve-2014-0556"],"last_seen_time":"2019-07-24T06:00:00.000Z","fix_id":691,"scanner_vulnerabilities":[{"port":null,"external_unique_id":"adobe-flash-apsb14-21-cve-2014-0556","open":true}],"asset_id":291633,"connectors":[{"id":7,"name":"Nexpose Enterprise","connector_definition_name":"Nexpose Enterprise","vendor":"Rapid7"}],"service_ticket":null,"urls":{"asset":"dummy.com/assets/291633"},"patch":true,"patch_published_at":"2014-09-11T07:57:40.000Z","cve_id":"CVE-2014-0556","cve_description":"Heap-based buffer overflow in Adobe Flash Player before 13.0.0.244 and 14.x and 15.x before 15.0.0.152 on Windows and OS X and before 11.2.202.406 on Linux, Adobe AIR before 15.0.0.249 on Windows and OS X and before 15.0.0.252 on Android, Adobe AIR SDK before 15.0.0.249, and Adobe AIR SDK & Compiler before 15.0.0.249 allows attackers to execute arbitrary code via unspecified vectors, a different vulnerability than CVE-2014-0559.","cve_published_at":"2014-09-10T01:55:00.000Z","description":null,"solution":null,"wasc_id":null,"severity":10,"threat":10,"popular_target":false,"active_internet_breach":true,"easily_exploitable":true,"malware_exploitable":true,"predicted_exploitable":false,"custom_fields":[],"first_found_on":"2019-07-24T06:27:26Z","top_priority":true,"risk_meter_score":100,"closed":false}}
我想解析这个 json 对象以获取所有键和值,最终将其输入到 tableRow 对象。
目前我看到的唯一解决方案是解析从我创建的 get 方法中获得的字符串并自己构建一个 TableRow 对象,但我想知道是否有人有更好的解决方案可以分享?
【问题讨论】:
-
杰克逊 (baeldung.com/jackson-object-mapper-tutorial) 或 GSON (github.com/google/gson)
标签: java json get httpresponse tablerow