JSP Progress Bar

后端 未结 3 1951
情书的邮戳
情书的邮戳 2021-01-12 07:50

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

3条回答
  •  北海茫月
    2021-01-12 08:38

    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

提交回复
热议问题