JSP进度栏 [英] JSP Progress Bar

查看:240
本文介绍了JSP进度栏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在JSP中有一个非常简单的方法来实现进度条。基本上我有一个JSP页面去调用一个方法的servlet,现在这个过程将运行很长时间,我想要像进度条一样,指示进度条,就像在eclipse任务栏中显示的当我们执行任何java程序。



我在这里找到了一个很好的教程 http://onjava.com/pub/a/onjava/2003/06/11/jsp_progressbars.html ,但似乎没有什么过时的。



有没有任何新的和简单的方法来实现?

解决方案



通常对于一个网络应用程序,如果你想要进度条,然后去AJAX路线是最好的,像上面提到的一些海报。
然而,我发现,在网络上,适合向用户指出 正在发生。只有在提交页面时,可以看到某种类型的微调框,然后在呈现页面时再次隐藏(请参阅此处 )。这是非常容易做到的,不会导致额外的性能下降,并且表明某种进展


Is there a quite easy way to implement progress bars in JSP. Basically I have a JSP page that goes to a servlet that calls up a method, now this process is going to run for a long time and I want to indicate the status of the progress just like the progress bar that shows up in the eclipse taskbar when we execute any java program.

I have found a nice tutorial here http://onjava.com/pub/a/onjava/2003/06/11/jsp_progressbars.html but it seems little outdated.

Are there any new and easy ways to implement this?

解决方案

Determining the progress of a particular task is a surprisingly complicated thing once you get into the details. How do you determine for example that you are 50% done? And what happens if the last 10% of your task takes 1/2 the total time?

Usually for a web app, if you do want progress bars, then going the AJAX route is best, as some of the posters mentioned above. I find, however, that on the web, it is suitable to indicate to the user the something is happening. Just have a spinner of some sort made visible when the page is submitted, and then hidden again when it is rendered (see here). This is very easy to do, causes no additional performance hit, and is indicative of some sort of progress

这篇关于JSP进度栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆