How to display wait for page load message when JSF page is loading
Hi everyone,
Requirement : in my jsp page i load & display my table when my drop down is populated. So i click a button when my drop down is selected. Upon clicking the button my table gets rendered and get displayed.
So, the issue the button runs a back end script which needs few minutes to load. So in that mean time i need to display some message on the jsp page.
Can sbdy help me on this ?
Thank you,
Karthik
[454 byte] By [
kbalas78a] at [2007-11-27 11:00:06]

# 2
Hi,
Thanks for the response..
It's the same jsp page. But the other half of the jsp page containing my datatable is not rendered until the result is calculated.
Thank you
Karthik
# 3
Not sure how your 'page' is calculating the data on buttonclick without a seperate request being made unless it is calculated on the client-side using javascript or applet... But...
The issue is not particularly a java related question. It is to do with the workings of HTTP as it is a stateless protocol. (For this prely I am ignoring the quite possible and potentially effective method of running a Java Applet to communicate with the servlet.)
If you have (for example) a textfield and a submit button on a HTML page, then you submit the form, the textfield and button will remain onscreen in most browsers (at least) until the header of the response page is recieved. A servlet (JSP) cannot send two responses as the browser will only 'take notice' of the response corresponding to the single request it sent.
If a page displaying "please wait" with some fancy progress graphics makes the request this will display until the response header is sent. Use javascript or a redirecting parameter diaplying the "please wait" and make the user's browser wait.
Or you can display an applet to communicate directly with the servlet to get a percentage bar
Hope this helps,
Bamkin
# 5
That's cool.
By using the XMLhttpRequest rather than a normal HTTP request the page does not necessarily reload!
I found a good to-the-point tutorial here http://www.w3schools.com/ajax/default.asp and a breif diagram explaining the innerworkings and progress bar example here https://bpcatalog.dev.java.net/nonav/ajax/progress-bar/design.html.
Cheers Balus :-)
Just as an aside: I wonder why it is called XMLhttpRequest... It is defined in the Javascript spec', not XML and is capable of carrying any text/html ect, not just XML. It was a copy of a microsoft API used originally in MIcrosoft Outlook for carrying XML but continuing this name into IE's and Firefox's ect javascript seems like an accident.
# 6
XML is just a collection of characters arranged in a human logical order. So are also HTML, "text", JSON, etcetera. It's all up to the client and the server how to interpret those arrays of characters.
That the object is called XMLHttpRequest is just due to the initial use of it. But in fact, and depending on the client and the server used, you can send every kind of a character array with it.