java常用检验接口control方式
2020-12-13 05:29
阅读:390
标签:service utf-8 tac code exception odi ble auto 中文乱码
@Controller public class ItemController { @Autowired private ItemService itemService; @RequestMapping("/item/{itemId}") //@ResponseBody public void getItemById(@PathVariable Long itemId,HttpServletResponse response) throws IOException { TbItem tbItem; try { tbItem = itemService.getItemById(itemId);
//如果输出数据中文乱码
//response.setCharacterEncoding("UTF-8");
//response.setContentType("text/html;charset=UTF-8"); response.getWriter().print(tbItem); } catch (Exception e) { e.printStackTrace(); System.out.println("fdjksdjfsdjkfksjdkfjsjdk"); } } }
java常用检验接口control方式
标签:service utf-8 tac code exception odi ble auto 中文乱码
原文地址:https://www.cnblogs.com/dianzan/p/11142258.html
文章来自:搜素材网的编程语言模块,转载请注明文章出处。
文章标题:java常用检验接口control方式
文章链接:http://soscw.com/index.php/essay/31140.html
文章标题:java常用检验接口control方式
文章链接:http://soscw.com/index.php/essay/31140.html
评论
亲,登录后才可以留言!