乱码分为进出两种: resp.setContentType("text/html;charset=utf-8"); req.setCharacterEncoding("utf-8"); 这样无论进出都处理了乱码问题。