Linked Questions
13 questions linked to/from How to parse a JSON string to an array using Jackson
2
votes
1
answer
974
views
How to create array field in by jackson based on json property prefix? [duplicate]
Say I have the following json string:
{
"name": "Foo"
"pic1": "some pic 1",
"pic2": "some pic 2",
"pic3": "some pic 3",
...
"picn": "some pic n"
}
I need to create following ...
133
votes
5
answers
259k
views
Deserialize JSON to ArrayList<POJO> using Jackson
I have a Java class MyPojo that I am interested in deserializing from JSON. I have configured a special MixIn class, MyPojoDeMixIn, to assist me with the deserialization. MyPojo has only int and ...
44
votes
2
answers
33k
views
Jackson - Deserialising JSON string - TypeReference vs TypeFactory.constructCollectionType
To deserialise JSON string to a list of class, different ways listed at StackOverflow question
Type 1 (docs link):
List<SomeClass> someClassList = mapper.readValue(jsonString, typeFactory....
1
vote
3
answers
11k
views
How to pass FormData and JSON object in ajax to Spring MVC Controller?
I need to pass both FormData and JSON object in an ajax call, but I get a 400 Bad Request error.
[artifact:mvn] org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver - Failed ...
1
vote
1
answer
3k
views
Jackson ObjectMapper deserialize object with array
There are some similar questions here and here, but they don't quite match my situation. My JSON string consists of an object with an array:
{
"data": [
{
"id": 1,
"title": "Sample ...
0
votes
2
answers
2k
views
How to deal with json string in java servlet
A variable called wrongAnswers which is an array of javascript objects is generated on the client.
It has the form
wrongAnswers = [
{"wrongAnswer": "Manzana", "wrongQuestion": "apple"},
{"...
-4
votes
2
answers
2k
views
How do I read multiple JSON objects in Java?
So this is my sample Json Text,
{
"Date": [
1545,
"20 January 2014"
],
"docText": "ABCD",
"docSource": "",
"docID": 99,
"docDate": "",
"Date": [
1930,
"1995/11",
"...
0
votes
1
answer
1k
views
How to get java to read JSON String with multiple objects in it?
I'm writing a program that receives a Json String, converts it to Java object and prints it out to the screen. Pretty simple stuff, but my problem is getting the program to read the Json String.
...
1
vote
1
answer
2k
views
Convert json String to List<List<String> with Jackson
I have a json String that's a list of a list of strings, and need to convert it to objects of class List<List<String>>.
Here it says how to convert from string to a list, but it doesn't ...
-3
votes
1
answer
1k
views
How to parse a JSON string to an list using Jackson
I have a String with the following value:
{
"keyA": {
"ID": "123",
"Name": "TESTA",
"Mobile": "1111"
},
"keyB": {
"ID": "456",
"Name": "TESTB",
"Mobile": "2222"
}
}
...
0
votes
2
answers
873
views
How to get size of list which contains JSONObject?
I have jsonobject in list which is of type string and the list contains two json object but size is giving 4.
JSONObject which are stored in list are-
[{"size":"S", "id":11}, {"size":"8", "id":19}]
...
0
votes
1
answer
806
views
OutOfMemoryError when Jackson deserializes JSON object
I have a problem with a very large JSON file that is too large to use ObjectMapper.readValue() into a JsonNode. I would like to use the solution from Out of memory error while parsing a large JSON ...
1
vote
1
answer
384
views
Need to insert .json file to MongoDB through java code
I am beginner. I have MongoDB running. My task is to insert Student.json file on to MongoDB through java code and not through mongoimport.
Student.java
public class Student {
@Id
private ObjectId ...