求助JQuery XMLHTTP 如何处理GZIP压缩数据

用GZIP压缩后, JQuery XMLHTTP获取的Response Data 如何显示
success: function(data) {
   
}  

Servlet doPost
    String encoding = request.getHeader("Accept-Encoding"); 
		 
		if (encoding != null && encoding.indexOf("gzip") != -1){
			response.setHeader("Content-Encoding" ,"gzip"); 
		    out = new GZIPOutputStream(response.getOutputStream());
		} else if (encoding != null && encoding.indexOf("comdivss") != -1){
			response.setHeader("Content-Encoding" , "comdivss"); 
		out = new ZipOutputStream(response.getOutputStream());
		}else{ 
		  out = response.getOutputStream(); 
		}
		PrintWriter writer=new PrintWriter(out);
		writer.write("resp data");
		writer.flush();

你可能感兴趣的:(jquery,servlet)