简体   繁体   English

如何在java中读取json数据并显示键值对的特定输出

[英]How to read json data in java and display particular output from key value pair

I have json file with data我有带数据的json文件

 ( "date" : "2019-1-2"
   "Group" : "xyz"
   "Bookname" : "harrypotter"
   "Url" : "https:dhdudgussisk"
),
( " date" : " 2015-2-3"
  " Group" : "qbc"
  "Bookname" : "happy"
  "Url" : "https://hdhdjdksksksks"
)

The code has to be in java written in a way such that when I change the input bookname value the output should display its respective url....some one please help me solve this代码必须是用 Java 编写的,这样当我更改输入书名值时,输出应该显示其各自的 url....请有人帮我解决这个问题

Lets hope we understood you right, you want to read out of an json with key-value method.希望我们理解正确,您想使用键值方法读取 json。

I think what could help you is knowing how to properly parse an json to java.我认为可以帮助您的是知道如何正确地将 json 解析为 java。

How to parse JSON in Java 如何在 Java 中解析 JSON

There is a lot of libraries providing this.有很多图书馆提供这个。 You should explore the internet before you asked a question which was answered many times and it is not hard to find a relevant tutorial.在你问一个被多次回答的问题之前,你应该先浏览一下互联网,不难找到相关的教程。

For example, the Jackson library can be used there.例如,可以在那里使用 Jackson 库。

Intro to the Jackson .杰克逊简介

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM