Display while data is retrieved on the backend
800461Dec 10 2009 — edited Dec 13 2009I know this may not be strictly a JSP related topic, but since it involves Java back-end processing, perhaps you will forgive me...
I have a screen (JSP) that has a form, which is submitted to the back end (Spring) and returns to itself displaying the form again and data in tables below the form. The problem is that sometimes it takes a long time to return the data, and users must sit in front of a screen that is seemingly doing nothing.
The goal was to provide them with something like a progress bar or a "Loading..." animation.
I did that using JavaScript which is triggered by loading the topmost element in the page and waiting for the last element to load, to stop displaying a "Loading..." animation.
But that only works while the page is loading, which is not such a big wait...
how can a similar effect be achieved while Java is retrieving data from the DB in the back-end?