简体   繁体   English

Java Web App FutureTask进度栏

[英]Java Web App FutureTask Progress Bar

I have a Java web application that performs a long running task via a struts action. 我有一个Java Web应用程序,它通过struts动作执行长时间运行的任务。 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. 我想显示任务的进度条,并想通过AJAX更新进度条,该AJAX调用一些操作以获取正在运行的线程的当前进度。

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? 如果操作A执行FutureTask线程,如何从另一个操作访问此FutureTask对象以获取其当前进度? Is this even possible or is there a better approach to this problem? 是否有可能解决这个问题?

Any help would be greatly appreciated. 任何帮助将不胜感激。

Thanks! 谢谢!

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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