Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JSP Progress Bar

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?

like image 726
Kavin Avatar asked May 04 '11 12:05

Kavin


2 Answers

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

like image 81
Java Drinker Avatar answered Oct 08 '22 01:10

Java Drinker


There is a lot of solutions for example jQuery.

You can use Jquery with Ajax to update progress bar:

http://jqueryui.com/demos/progressbar/

like image 25
danny.lesnik Avatar answered Oct 08 '22 02:10

danny.lesnik