2
peternameyakj
2024-08-14 9bcf85f8d8f9b503e386a67924f5943cd77bd813
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package kernel.util;
 
import java.io.IOException;
import java.io.PrintWriter;
 
import javax.servlet.http.HttpServletResponse;
 
public class ServletUtil {
    
    public static final String ENCODING = "UTF-8";
    
    /**
     * 输出XML信息
     * 
     * @param response
     * @param xmlStr
     * @throws IOException
     */
    public static void outputXML(HttpServletResponse response, String xmlStr) throws IOException {
        response.setContentType("text/html;charset=" + ENCODING);
        PrintWriter out = response.getWriter();
        out.println(xmlStr);
        out.close();        
    }
}