JavaWeb Servler respone 返回值的设置

// xml
resp.setContentType("text/xml");
resp.setCharacterEncoding("UTF-8");


// json中文设置
resp.setHeader("Cache-Control", "no-cache");
resp.setContentType("text/json;charset=utf-8");

// jsonp
resp.setHeader("Cache-Control", "no-cache");
resp.setContentType("text/javascript;charset=utf-8");

你可能感兴趣的:(JavaWeb Servler respone 返回值的设置)