How to save array of objects into DTO class

So I have passed data in ajax as:

   “name” : “Rahul”,
   “age” : “23”,
   “information” : [
         “id” : “901”,
         “role” : “developer”
   “salary” : “21000”,

For this I have created two DTO classes as

class EmployeeDTO {
   private String name;

   private String age;

   private List<InformationDTO> informationDto;

   private String salary;

//Their getters and setters

I mentioned List because I took information as an array of objects. Then I have another DTO class

class InformationDTO {

   private String id;

   private String role;

Now in my Sling Servlet I am trying to get values of information array like

String information = request.getParameter(“information”);

But I am getting null value. How can I store this array information in my DTO class Employee using InformationDTO? How to save array of objects into DTO class using sling servlet?

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum