下面是我尝试访问 json 的方式,我需要用 jQuery 更改 dataType 吗?
service :
@RequestMapping("VIEW")
@ResourceMapping("myUrl")
public MappingJacksonJsonView savePortletData() {
jsonString = outStream.toString();
argMap.addAttribute("portletDataResponseJson", "{\"test\": \"tester2\"}");
return new MappingJacksonJsonView();
}
}
jquery:
$.ajax({
url: "myUrl",
type: 'post',
dataType : "json",
success : function(jsonResponse) {
console.log('JSON IS '+jsonResponse;
},
});