http streaming using java servlet
Posted
by
Shamik
on Stack Overflow
See other posts from Stack Overflow
or by Shamik
Published on 2011-11-20T01:45:43Z
Indexed on
2011/11/20
1:51 UTC
Read the original article
Hit count: 297
I have a servlet based web application which produces two sets of data. One set of data in the webpage which is essential and other set which is optional. I would like to render the essential data as fast as possible and then stream the optional data. I was thinking of writing the essential data to the output stream of HttpServletRequest and then call HttpServletRequest.flushBuffer() to commit the response to the client, but do not return from the servlet code, but instead create the optional data , write that to the outputstream again and then return from servlet code. What are the things that could go wrong in this scheme ? Is this a standard practice to achieve this goal?
© Stack Overflow or respective owner