I have a SpringBoot application with these dependencies:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jersey</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
I have a method on my controller as follows:
@RequestMapping(value = "/liamo", method = RequestMethod.POST)
@ResponseBody
public XResponse liamo(XRequest xRequest) {
...
return something;
}
I am sending a JSON object from my HTML via AJAX with some fields of an object of type XRequest (this is a simple POJO without any annotations). However, my JSON is not built in the object according to my controller method, and its fields are zero.
What did I skip for automatic deserialization on my controller?
source
share