I need to transfer from server to client 2 array
return ResponseEntity.status(HttpStatus.OK).body(new Gson().toJson( new Gson().toJson(calendarService.createMonthlyEvents(monthlyEventDto)) + new Gson().toJson(calendarService.getDaysWerentCreated()))); I tried to create an object on the server, assign each name to the corresponding array:
new Gson.toJson("{ daysWhenCreated:" + new Gson().toJson(calendarService.createMonthlyEvents(monthlyEventDto))) + ", daysWhenNotCreated: " + new Gson().toJson(calendarService.getDaysWerentCreated() + "}"); A json type string comes to the client, I try to get a 1 result.daysWhenCreated from there, but I get undefined .
Tell me, please, what could be the problem?
Update
json output line is as follows:
"{ [{"id":879,"name":"hhnefrd","startTime":"2016-12-31T11:18:00","endTime":"2016-12-31T12:18:00","roomId":0,"description": "","recurrentId":22,"color":"#1ba1e2"}], ["30/1","31/1"] }"