我正在使用servlet在我的Web应用程序中上传文件。我想在上传时显示进度栏。我已经看过一些Ajax + Progresslistener示例,一个here。
他们在doPost()方法中创建一个会话对象并设置一个新的属性Listener。除此之外,我以前的doPost()方法代码和教程代码是相同的。My question is they are setting the Listener Attribute one time, at the beginning. How it will update the bytesRead frequently
(我对此并不陌生,所以,我的问题可能不合理)
他们在doGet()方法中检索侦听器属性,并从中提取所需的信息。This part also, i am not able to understand. They are not implementing ProgressListener class(Searches, led me to this Class).
我知道一些DWR。因此,如果我了解服务器端更新数据传输的过程,则可以使用它从服务器获取数据传输信息。
有人能解释一下服务器端的流程吗?
或任何链接或建议将不胜感激!
谢谢!
最佳答案
关于java - 文件上传进度条?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4192858/