MCPcopy Create free account
hub / github.com/diyhi/bbs / writeToWeb

Method writeToWeb

src/main/java/cms/utils/WebUtil.java:277–286  ·  view source on GitHub ↗

本方法封装了往前台设置的header,contentType等信息 @param message 需要传给前台的数据 @param type 指定传给前台的数据格式,如"html","json"等 @param response 响应信息 @throws IOException

(String message, String type, HttpServletResponse response)

Source from the content-addressed store, hash-verified

275 * @throws IOException
276 */
277 public static void writeToWeb(String message, String type, HttpServletResponse response) throws IOException{
278 response.setHeader("Pragma", "No-cache");
279 response.setHeader("Cache-Control", "no-cache");
280 response.setDateHeader("Expires", 0);
281 response.setContentType("application/" + type +"; charset=utf-8");
282 response.getWriter().write(message);
283 response.getWriter().close();
284
285
286 }
287
288
289 /**

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected