本方法封装了往前台设置的header,contentType等信息 @param message 需要传给前台的数据 @param type 指定传给前台的数据格式,如"html","json"等 @param response 响应信息 @throws IOException
(String message, String type, HttpServletResponse response)
| 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 | /** |
nothing calls this directly
no outgoing calls
no test coverage detected