jsp中的流数据显示
我的服务返回像这样的流数据...
return new BufferedReader(new InputStreamReader(process.getInputStream()));
我想在jsp页面中显示流数据..这显示了cmd peompt中发生的情况...
我的jsp页面应该显示当前数据在 cmd 提示符中显示状态,并且当 cmd 提示符中显示新数据时应显示更新的内容。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我会使用(反向)AJAX(Comet )。通过这种方法,您可以缓冲服务器端的任何输出(让它成为某个进程输出),并且客户端以某种方式异步接收该数据。
有几种方法:
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:
您至少要实现一个小程序来实现这一目标。 Html 输出无法处理流,除非调用一个特殊的插件来处理此流(如嵌入式媒体播放器)。
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.