I am currently working on a file conversion program, once the file has been uploaded it will convert the file to different file formats(ppt,pdf) this will usually take long depending on the file size. Since the file conversion is happening on the back end, I want the user to see the progress of the file conversion( something like progress bar eg “52% file being converted”) is there anyway I can display to the user the current progress of the file conversion(that’s happening on the back end)? During file conversion I am only able to show the status(in numbers(provided by the API I am using))
I have no idea where to start can someone provide some insight or approach?
If you are using Struts2 take a look at
Execute and Wait Interceptor. It creates new thread with your task which will be executed in the background while you can show some progress to the user.In
struts.xmlfile addexecAndWaitinterceptor to your long running action and define two resultswaitandsuccess.You still need to poll this action in your JSP via AJAX or simple page refresh.