0

using the DataForm object I found that its posting values correctly to server. Here is the screenshot enter image description here

but on server I am getting null for these object. Here is my server side code

    @RequestMapping(method = POST, value = "/create", produces = "application/json")
    @ResponseBody
    public UIResponse createDS(@Validated @ModelAttribute(value = "dS") DSDto dSDto,
            BindingResult result) {
 //here dSDto.name and dSDto.description is null
}
coure2011
  • 40,286
  • 83
  • 216
  • 349

1 Answers1

1

you have to add the @RequestBody annotation so Spring would convert the incoming JSON to a object from the post body .take a look at this stack overflow post @RequestBody and @ResponseBody annotations in Spring

Community
  • 1
  • 1
Robert Ellis
  • 714
  • 6
  • 19