Java Web App FutureTask Progress Bar

做~自己de王妃 提交于 2019-12-25 03:52:23

问题


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!


回答1:


Put the FutureTask or the Callable in the Session and then pull it out in the other action to check the progress.



来源:https://stackoverflow.com/questions/7474080/java-web-app-futuretask-progress-bar

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!