How to send complex JSON structure from angular to spring controller


I've a JSON like below in my angular controller, which i need to
post to Spring controller.



var items={"A":"aa",
"B":"bb",
"C":{"D":"dd", "E":"ee"}
};

$http.post('localhost:8082/ProjectName/posting',items)
.success(function(data,status,headers, config){
alert("success");
})
.error(function(error){
alert(error);
});


In my Spring controller



@RestController
public class ForPost{
@RequestMapping(value="/posting",method=RequestMethod.POST)
public @ResponseBody List forPosting(@RequestBody PostingModel
postingModel){
System.out.println("Print all values received");
.
.
.
.
}
}


I'm thinking for this kind of nested JSON, I need to have
nested POJO.
something like:



public class PostingModel{
String A;
String B;
POJOForC C;
/* getter setter below*/
}

puublic class POJOForC{
String D;
String E;
/* getter setter below*/
}


I get error message: The request sent by client was
syntactically incorrect().

Am I accepting the values correctly? Need to fix something in
POJO?


- Technology - Languages
+ Webmasters
+ Development
+ Development Tools
+ Internet
+ Mobile Programming
+ Linux
+ Unix
+ Apple
+ Ubuntu
+ Mobile & Tablets
+ Databases
+ Android
+ Network & Servers
+ Operating Systems
+ Coding
+ Design Software
+ Web Development
+ Game Development
+ Access
+ Excel
+ Web Design
+ Web Hosting
+ Web Site Reviews
+ Domain Name
+ Information Security
+ Software
+ Computers
+ Electronics
+ Hardware
+ Windows
+ PHP
+ ASP/ASP.Net
+ C/C++/C#
+ VB/VB.Net
+ JAVA
+ Javascript
+ Programming
Privacy Policy - Copyrights Notice - Feedback - Report Violation 2018 © BigHow