Home > front end >  Backend and recipients of a complex type, get less than value
Backend and recipients of a complex type, get less than value

Time:03-03

Front end and data looks something like this:
{
Id: 1
Name: 'name'
The list:
{cname: 'son the name' cid: 11}
]
}

My background is to use a CompanyDto object, and have getset method, field below
private Long id;
private String name;
Private List
The child object attributes:
Private String cname.
Private cid.

Control layer is (@ RequestBody CompanyDto CompanyDto)
Through the breakpoint is found outside of id, name all packaging, there are data in the list, but inside the corresponding cid and cname are null

Front-end ajax no problem don't know why the collection in the child object encapsulation to the corresponding field?

CodePudding user response:

Private cid. The column type,

CodePudding user response:

Found the problem the {key: "value"} and {" key ":" value "} is 2 different types of data, are generally was no problem with quotation marks
  •  Tags:  
  • Ajax
  • Related