I have a question on submitting JSON data to server using DOJO. I have JSON data in the below format :
The AJAX call is as below :Code:{"description":"vice-president"} ---> This is stored in a javascript variable jsonData
In my controller, I have written a method as folllows :Code:dojo.xhrPost({ url : url, -- > url to the controller (/myContextRoot/getJsonData.do) content : jsonData, headers : { "Content-Type" : "application/json,charset=utf-8" }, load: function(response,ioargs) { alert('success'); }, error : function(response,ioargs) { alert('error'); } });
And my value object is below :Code:@RequestMapping(value = "/getJsonData.do",method=RequestMethod.POST) public @ResponseBody String getJsonData(@RequestBody SampleVO sampleVO) { System.out.println("Inside controller"); return "success"; }
When I perform an AJAX call to post the JSON data to the server, I am getting the error :Code:public class SampleVO implements Serializable { private String description; getter/setter for the above. }
org.codehaus.jackson.JsonParseException : Unexpected character ('j' (code 106)) : expected a valid value (number,string,array,object,'true','false' or 'null')
I am using DOJO 1.5 and Spring 3.0
Greatly appreciate if you guys can help me find the root cause.
Thanks!


Reply With Quote
