1

My service returns Stream data like this...

return new BufferedReader(new InputStreamReader(process.getInputStream()));

I want to display the stream data in jsp page.. This shows what is going on in cmd peompt...

My jsp page Should display the current data which is in cmd prompt to show status and should display updated content when new data is displayed in cmd prompt.

Muthu
  • 1,550
  • 10
  • 36
  • 62

2 Answers2

0

you are going to implement an applet atleast to achieve this. Html output cannot handle streaming, unless there was a special plugin that was invoked to handle this stream like an embedded media player.

r0ast3d
  • 2,639
  • 1
  • 14
  • 18
0

I would use (reverse-)AJAX (Comet). With this approach you buffer whatever output you have on the server side (let it be some process output) and the client receives that data asynchronously somehow.

There are several approaches:

  • Atmosphere library
  • Periodic polling (I think this is how Bamboo display build progress, which is essentially what you want)
  • Long-running AJAX connection streaming data
Tomasz Nurkiewicz
  • 334,321
  • 69
  • 703
  • 674