Hi!

You might consider this option too.
In this example a "Please wait, processing ..." text will appair in a new window
(requeries JavaScript) until the main page is  being displayed.

   1 step:
    Create a HTML page wich will display  'processing...please wait'
     like this: <html>
                   <head></head><body bgcolor="#FFFFFF">
                    Processing data.... please wait
                    </body></html>

  Lets call this html:
                               wait.html
2 step:

     in the page invoking the servlet :
   <form action="..../YourServlet" method="post"  >
    add like this:
                       <form action="..../YourServlet" method="post"
                      onSubmit =
"window.open('http://somewhere/wait.html','waitwindow','width=400,height=265
,resizable=yes,scrollbars=no');" >

   notice the wait.html is the same as  the 1 step
  do NOT change waitwindow only the width and height if U want
    3. step:

   The serlvet's response page must send as response:
      PrintWriter toClient=res.getWriter();

       ......
        toClient.println("<html>");
        toClient.println("<head>");
        toClient.println("<script language=\"JavaScript\">");
        toClient.println("function closewaitwindow(){");

toClient.println("waitwindow=window.open('','waitwindow','width=400,height=2
65,resizable=yes,scrollbars=no');" );
        toClient.println("waitwindow.close();");
        toClient.println("}");
        toClient.println("</script>");

        toClient.println("</head>");
        toClient.println("<body onLoad=\"closewaitwindow()\">");

     and of course Anything after that.

Notice : this will close the wait window only after the html page is loaded
completly.
If u want that that wait window to close as soon as the page is stating to
be displayed
instead of above send response :

        toClient.println("<html>");
        toClient.println("<head>");
        toClient.println("<script language=\"JavaScript\">");


toClient.println("waitwindow=window.open('','waitwindow','width=400,height=2
65,resizable=yes,scrollbars=no');" );
        toClient.println("waitwindow.close();");

        toClient.println("</script>");

        toClient.println("</head>");
        toClient.println("<body >");

        ..............


  That's all !!

I have tried  it with both Internet Explorer and Netscape and it works !

Hope it helps,

If something is not working let me know.

Best wishes,
                            Andras



-----Original Message-----
From: Kenia Nimesh <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: Tuesday, June 29, 1999 3:04 PM
Subject: Waiting for a query

Thru servlets I am accessing my oracle database.My query takes a long time to reterive and print the result.
What I  want is till the time the query is executed and displayed . I  want to show the user 
 "Wait for some time , the query is being executed". , and once I get the query executed and result comes at the client side the display message should be  replaced by actual result.
 
How should I do it??
 
Thanks in advance
Nimesh Kenia
 
 

Reply via email to