首页 > 其他 > 详细

hello

时间:2014-03-25 02:17:04      阅读:408      评论:0      收藏:0      [点我收藏+]

 

haha

 

@Autowired
    private BufferedRequestContext brc;

hello

 

public void execute(@Param("to") int toNumber) throws Exception {
        // 必须关闭buffering,未完成的页面才会被显示在浏览器上。
        brc.setBuffering(false);

        // 设置content type,但不需要设置charset,框架会设置正确的charset。
        response.setContentType("text/html");

        PrintWriter out = response.getWriter();

        out.println("<html>");
        out.println("<head>");
        out.println("  <title>Count to " + toNumber + "</title>");
        out.println("</head>");
        out.println("<body>");

        for (int i = 1; i <= toNumber; i++) {
            for (int j = 0; j < 10000; j++) {
                out.print(i);
            }

            out.println();
            out.flush(); // 将当前的结果立即显示到浏览器上

            Thread.sleep(1000); // 特意等待1秒,仅用于演示。
        }

        out.println("</body>");
        out.println("</html>");
    }


 




hello,布布扣,bubuko.com

hello

原文:http://www.cnblogs.com/leiwei/p/3622228.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!