<% int i = 1; try { while (true) { out.print(""+(i++)+""); out.flush(); try { Thread.sleep(3000); } catch (InterruptedException e) { out.print("11"+e+""); } } } catch (Exception e) { e.printStackTrace(); out.print("222"+e+""); } %> 当用TOMCAT启动项目的时候 JSP页面就会产生这样的一个异常: java.io.IOException: Illegal to flush within a custom tag 后台打印出异常为: java.io.IOException: Illegal to flush within a custom tag at javax.servlet.jsp.tagext.BodyContent.flush(BodyContent.java:80) at org.apache.jsp.default_jsp._jspService(default_jsp.java:152) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315) at org.apache...