Hi!
You might consider this option too.
In this example a "Please 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
> Hello all,
>
> Does anyone out there know how to generate a basic looking html
> page that can be displayed while my java code does database querying?
>
> I've seen some sites that generate a page that just says something
> like "We are searching for your requested records" while the query is
> being executed. After execution my results are displayed and the
> searching page disappears.
>
> Any idea how this is done?
>
> Jaman
>
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html