Hi Jeetandra!!
Your question was very challanging so I have
resolved it
with JavaScript.
Please follow the instructions:
1 step:
Create a HTML page wich will display
'processing...please wait'
like this: <html>
<head></head><body bgcolor="#FFFFF">
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=265,resizable=yes,scrollbars=no');" );
toClient.println("waitwindow.close();");
toClient.println("}");
toClient.println("</script>");
toClient.println("</head>");
toClient.println("<body onLoad=\"closewaitwindow()\">");
toClient.println("<head>");
toClient.println("<script language=\"JavaScript\">");
toClient.println("function closewaitwindow(){");
toClient.println("waitwindow=window.open('','waitwindow','width=400,height=265,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
loadede 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=265,resizable=yes,scrollbars=no');" );
toClient.println("waitwindow.close();");
toClient.println("<head>");
toClient.println("<script language=\"JavaScript\">");
toClient.println("waitwindow=window.open('','waitwindow','width=400,height=265,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
U can contact me at : [EMAIL PROTECTED] i should say 14 hours
per day
