简体   繁体   English

进度栏Java servlet和jsp

[英]Progress bar Java servlet and jsp

I'll try to explain my problem as clear as possible. 我将尽力解释我的问题。

I developed an app (Java EE, servlet, jsp) where i try to read an excel file and make some request on different api to get some results for each line. 我开发了一个应用程序(Java EE,servlet,jsp),在其中尝试读取excel文件并在不同的api上发出一些请求以获取每一行的结果。 That's mean the time to read the excel file and make all the request depends oh many line are present in the excel file. 这意味着读取excel文件并作出所有请求的时间取决于excel文件中是否存在许多行。

I would like to inform to the user where is he on the process and for that, i'll need to implement a progress bar which one is according to the excel file. 我想通知用户他在程序中的位置,为此,我需要实现一个进度条,该进度条根据excel文件而定。

Step on the app : 踩到应用程序:

  1. The user arrives on the home page, he uploads the excel file on the jsp page. 用户到达主页,他在jsp页面上上传excel文件。
  2. He click on validated button when it's ok for him. 如果可以的话,他单击“已验证”按钮。
  3. the validated button redirect on the uploading servlet 经过验证的按钮重定向到上传的servlet
  4. On the uploading servlet, we read all the excel file and make the call to the differents api, when it's done, we redirect to the result pages jsp (upload jsp). 在上载的servlet上,我们读取了所有excel文件,并调用了differents api,完成后,我们将重定向到结果页面jsp(上传jsp)。

Do you have an idea to show the progress bar in percent in the 4th step ? 您是否有想法在第四步中以百分比显示进度条?

Thank's to all 谢谢大家

In this case make use of ajax call. 在这种情况下,请使用ajax调用。 Every time you progress with data read/api call reply to javascript function and progress the bar accordingly. 每次您进行数据读取/ api调用时,都会回复javascript函数并相应地进度条。

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

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