冬天学代码春天放风筝
2016-11-12 11:09
{"courseId":12223,"title":"娣卞叆娴呭嚭java璇剧▼","imgPath":"resource/imgs/course-img.jpg","learningNum":12345,"duration":7200,"level":2,"levelDesc":"涓骇","descr":"澶氱嚎绋嬫棩甯稿紑鍙戝父鐢ㄧ煡璇嗭紝鍛靛懙mow","chapterList":null}
代码如下:
@RequestMapping(value="/{courseId}",method=RequestMethod.GET)
public @ResponseBody Course GetJson(@PathVariable Integer courseId){
return courseService.getCoursebyId(courseId);
}
是返回乱码是吧?你在你的代码中加入响应的代码,让它以utf-8的编码响应response.setContentType("text/html; charset=utf-8");
Spring MVC起步
195972 学习 · 572 问题
相似问题