if I have a JSP page that has a sql statment that pulls records from db. The db records is huge and when loading, the web page shows a blank page. How could I put an animated gif during the time when the data is loading ? Thank you.
You can try this .. document.writeln('<HTML><TITLE></TITLE><BODY><DIV STYLE="position:absolute;left:10;font-Family:Sans-Serif;font-Size:18pt;visibility:show;"><CENTER><FONT COLOR="green"><B>Loading....</B></FONT></CENTER></DIV></BODY></HTML>'); Hope this helps you. Regards Dushyant Bhardwaj
Thank you for your prompt reply. Do you mean this: ---- out.println(<HTML><TITLE></TITLE><BODY><DIV STYLE="position:absolute;left:10;font-Family:Sans-Serif;font-Size:18pt;visibility:show;"><CENTER><FONT COLOR="green"><B>Loading....</B></FONT></CENTER></DIV></BODY></HTML>'); SQL Statement ... ---- Thanks again.
I've done something similar using the following trick: Suppose you are on page A, and the user clicks a button which calls a JSP or Servlet to load the data from the database. On page A, when the button is clicked, I set a <DIV> to appear and display an animated .gif which basically displays the usual animation you see when file processing is occurring. Page A will remain visible until the request is processed by the server and returned to the client, so while the request is being processed, the user will see your .gif.
You can also send the user to an intermediate page which shows some "loading "text and a "progress bar" and the page can refresh every X seconds and during the refresh looks for the data (perhaps in a session variable or something) then when a refresh occurs and the data is there, the user is forwarded to the actual data display. For the "progress bar", you can display it in a table that looks like a progress bar and move the indicator right and left to show some movement. I just did this myself in a Struts web-app I'm working on and it turned out very nice (IMO). brian
Post by:autobot
I don't always make ads but when I do they're tiny
a bit of art, as a gift, the permaculture playing cards