拦截器如下:
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { PrintWriter writer=response.getWriter(); response.setContentType("application/json;charset=UTF-8"); response.setCharacterEncoding("UTF-8"); writer.println("{"language":"简体中文"}"); writer.flush(); writer.close(); return false; }
上面返回时,中文只显示几个问号。Controller里返回的中文是不会乱码的。什么回事呢?
付费偷看金额在0.1-10元之间
一周热门 更多>