Streaming HTML from Java web application
How to achieve continuous HTML streaming in a Java web application?
Like, making the page keep on loading (indicates) and push data f开发者_开发知识库rom server.
Using ajax you can call the server continuously and continue to refresh parts of the page.
Obviously you would be better using timeouts and not continuously.
Depending on whether you're talking about doing content replacement (multipart/replace) or doing Comet-style push you can look at http://www.servlets.com/cos/javadoc/com/oreilly/servlet/MultipartResponse.html (for multipart replacement: some IP cameras use similar techniques to do crude video) or look at things like http://tomcat.apache.org/tomcat-6.0-doc/aio.html or http://blogs.oracle.com/enterprisetechtips/entry/asynchronous_support_in_servlet_3 for Comet streaming.
精彩评论