protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String name=request.getParameter("name"); String age=request.getParameter("age"); response.setContentType("text/html; charset=utf-8");//设置响应头文本格式 // System.out.println("name="+name); // System.out.println("age="+age); PrintWriter out=response.getWriter(); out.println("name="+new String(name.getBytes("iso-8859-1"),"utf-8")+"age="+age); System.out.println("name="+new String(name.getBytes("iso-8859-1"),"utf-8")); System.out.println("age="+age); }
但是控制台打印的是:
请大神指教
相关分类