|
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
|
- Waiting for a query Kenia Nimesh
- Re: Waiting for a query Steven J. Owens
- Re: Waiting for a query Jean-Michel Augusto
- Re: Waiting for a query Ted Neward
- Andras Balogh
