Java中Response返回双引号和XMl内容

session = request.getSession();
   request.setCharacterEncoding("utf-8");
   response.setContentType("text/xml;charset=utf-8");
   // 设定字符编码
   response.setCharacterEncoding("utf-8");
   response.setHeader("Cache-Control", "no-cache");
   response.setHeader("Pragma", "no-cache");
   out = response.getWriter();

 

 

String result_end = "<favour  res=\""+result_code+"\"  restext=\""+result+"\"></favour>";
    String tlen = result_end.getBytes().length + "";
    response.addHeader("ContentLength", tlen);
    out.println(result_end);
    out.flush();
    out.close();

你可能感兴趣的:(java,xml,String,session)