简体   繁体   中英

Java Web App FutureTask Progress Bar

I have a Java web application that performs a long running task via a struts action. I would like to display a progress bar for the task and would like to update the progress bar via AJAX which calls some action to get the current progress of the running thread.

What is the best practice for accomplishing this? If action A executes the FutureTask thread, how do I access this FutureTask object from another action to get its current progress? Is this even possible or is there a better approach to this problem?

Any help would be greatly appreciated.

Thanks!

将FutureTask或Callable放入会话中,然后在其他操作中将其拉出以检查进度。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM