@RequestMapping(value={"/list"},method=RequestMethod.GET) @ResponseBody public DeviceList getdevicelist(HttpServletRequest request, HttpServletResponse response) { String m_unit=request.getParameter("khnuit"); m_unit=EncodingTool.encodeStr(m_unit); DeviceList ds=new DeviceList(deviceService.find(m_unit),1,0,20); return ds; } public static class EncodingTool { public static String encodeStr(String str) { try { return new String(str.getBytes("ISO-8859-1"), "UTF-8"); } catch (UnsupportedEncodingException e) { e.printStackTrace(); return null; } } }
原文地址:http://luanxiyuan.iteye.com/blog/1849169