这样简单的方法
@RequestMapping(value = "/jsonp", method = RequestMethod.GET)@ResponseBodypublic String jsonp(@RequestParam("c")String callBack) throws Exception{ ObjectMapper objectMapper = new ObjectMapper(); Map<String, Object> map = new HashMap<String, Object>(); map.put("data", "<p>jsonp data<p>"); return objectMapper.writevalueAsString(new JSonPObject(callBack,map));}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)