Hi Ganesh:
Here's a "Please wait" implementation that i found in the Java pro web site:
http://www.devx.com/free/tips/tipview.asp?content_id=3254
I haven't tested it , but you may want to.
What I have tested tested, though, is the following idea (also got from (the
paper issue of) Java pro)), which works quite nicely and which Is really nice
because you can be reasonably certain you don't need to worry about browser
incompatabiliies (due to minimal use of JavaScript). Of course if the user turns
off Javascript, all bets are off! Here goes:
> <form name="initialform" action="/servlet/ShowWaitMessage" method="POST"
> ENCTYPE="application/x-www-form-urlencoded">
>
> <INPUT TYPE=TEXT NAME="name" VALUE="whatever">
>
> </form>
>
> --------------------------------------------------------------------------
>
> Code for showWaitMessage.java: (basically just save all input params as
session vars..)
> public class ShowWaitMessage extends HttpServlet{
>
> public void doGet/doPost(HttpServletRequest req, HttpServletResponse resp)
> throws ServletException, IOException
> //..blah..blah..
> session.setAttribute("name" req.getParameter("name"));
>
> //more blahs..
> resp.sendRedirect(htmlFilesDirectory + "waitMessage.jsp");
> }
> }
> --------------------------------------------------------------------------
>
> Code for waitMessage.jsp: (and here's where's the smarts are: display the wait
> message page and then use javascript to go on to the "main" servlet..)
>
> <HTML>
> <HEAD>
>
> <SCRIPT LANGUAGE='JavaScript'>
> function goToMainServlet(){
> this.location="/servlet/MyMainServlet?showResults=true";
> }
>
> timeout=window.setTimeout("goToMainServlet();", 1000); //The function
goToMainservlet() is executed 1 minute after this page is displayed.
> </SCRIPT>
> </HEAD>
> <BODY bgcolor=white class=bodytext>
> <CENTER>
> <TABLE WIDTH=400>
> <TR><TD>
> <B>Our servlet is hard at work. Please be patient while we prepare your
results.</B>
> </CENTER>
> </TD></TR>
>
> </TABLE>
> </CENTER>
>
> --------------------------------------------------------------------------
>
> Code for MyMainServlet.java: (pick up all the session vars and then you're
off to the races!)
> public class MyMainServlet extends HttpServlet{
> public void doGet(HttpServletRequest req, HttpServletResponse resp)
> throws ServletException, IOException
>
> //..blah..blah..
>
> session.getAttribute("name");
>
> //more blahs..
> resp.sendRedirect(htmlFilesDirectory + "whatever.jsp");
> }
> }
>
> --------------------------------------------------------------------------
> Enjoy!
> Geeta
"Ramu, Ganesh (MED)" wrote:
> Hi Everbody
>
> In the Handle service method of the servlet i having a method which takes
> some time.. to execute because of databases conn..etc because the that
> mehtod
> is not complete the user does not get any notification what is happening on
> the server side... Is there any best way in which user can informed that his
> servlet is exceting the particular method, it would take some time for
> response and that way making user more confortable..
>
> Ganesh R
>
> ___________________________________________________________________________
> 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
___________________________________________________________________________
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