ITeye博客

掌控上传进度的Ajax Upload

congjl2002 · 2008-06-30 21:06 · 【转】实用 · Markdown

原文地址: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.

UploadListener listener = new UploadListener(request, 30);

To run the example, just place the war file in your favorite servlet engine’s deployment dir.

评论(1)

  1. #1 楼 · teddyyxq · 2008-06-30 22:00

    这个例子我有,但是怎么和struts结合起来啊,我网上查了很多资料,但是好像都是1个例子,都是转发的,我现在的问题怎么结合struts,结合spring我会,你给的这个例子他是直接调用的upload.jsp页面处理的dwr调用后台java上传

评论功能维护中,当前仅展示历史评论。