PrintWriter输出XML中文乱码解决方法:
protected void doPost(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
resp.setContentType("text/xml;charset=utf-8");
PrintWriter pw = resp.getWriter(); //获取PrintWriter对象
pw.println("");
pw.println("");
pw.println("... ...");
pw.println("");
pw.flush();
pw.close();
阅读(4754) | 评论(1) | 转发(0) |