response:控制浏览器定时刷新

private void test1(HttpServletResponse response) throws IOException {
response.setCharacterEncoding("UTF-8");
response.setContentType("text/html;charset=UTF-8");
response.setHeader("refresh", "3");
String data=new Random().nextInt(1000)+"";
response.getWriter().write(data);
}

-------------------------------------------------------------------------------

 

posted @ 2017-03-20 17:31  贱贱的小帅哥  阅读(119)  评论(0编辑  收藏  举报