原文地址:http://www.telio.be/blog/2006/01/06/ajax-upload-progress-monitor-for-commons-fileupload-example/
Don’t laugh .. I did not get any comments from my previous post (normal, nobody reads this blog except me :-)), so I decided to take the time to put together a little sample of a Java AJAX file upload progress bar example.
For people who never used DWR, it can also serve as a nice example of how simple it is to use.
The example has been kept to the strict minimum to be self explanatory and it not supposed to be used as is .. (java code is a JSP aarrrggg …).
I also added a delay during the upload so that you get a chance to actually see the progress bar move when the server and the client are on the same machine.
To run the example, just place the war file in your favorite servlet engine’s deployment dir.
Don’t laugh .. I did not get any comments from my previous post (normal, nobody reads this blog except me :-)), so I decided to take the time to put together a little sample of a Java AJAX file upload progress bar example.
For people who never used DWR, it can also serve as a nice example of how simple it is to use.
The example has been kept to the strict minimum to be self explanatory and it not supposed to be used as is .. (java code is a JSP aarrrggg …).
I also added a delay during the upload so that you get a chance to actually see the progress bar move when the server and the client are on the same machine.
UploadListener listener = new UploadListener(request, 30);To run the example, just place the war file in your favorite servlet engine’s deployment dir.
本文提供了一个使用Java和AJAX实现的文件上传进度条示例,演示了如何利用DWR简化开发过程。该示例适用于希望了解AJAX文件上传机制的开发者。
876

被折叠的 条评论
为什么被折叠?



