개발 일반
Spring 3.1 에서 한글이 깨질경우
안드로이
2015. 1. 16. 18:04
Spring 3.1 에서 한글이 깨질경우 produces="application/json; charset=utf8" 를 적용하면 됨.
XXXXController.java 파일에서..
@RequestMapping(value = "store", method = {RequestMethod.POST, RequestMethod.GET}, produces="application/json; charset=utf8")
@ResponseBody
public String getStoreList(HttpServletRequest req, HttpServletResponse res) {
List<Map<String, String>> list = service.getStoreList(req.getHeader("STORE_CODE"));
Gson gson = new Gson();
return gson.toJson(list);
}