Web-service using spring in which I have to get the params from the body of my post request? The content of the body is like:-
source=”mysource”
&json=
You can bind the json to a POJO using MappingJacksonHttpMessageConverter . Thus your controller signature can read :-
public ResponseEntity saveData(@RequestBody RequestDTO req)
Where RequestDTO needs to be a bean appropriately annotated to work with jackson serializing/deserializing. Your *-servlet.xml file should have the Jackson message converter registered in RequestMappingHandler as follows :-