Geeta,

Thankyou very much actually, I got one more idea that basically orginated
from
JGuru which right now i am using it for my program..

Basically thing is like this.. i will be using a servlet which connect to a
system and displays the list of files in them and the user then select them
download them..

now when the user calls servlet the serlvet connects to system this would
take few minutes and there is another class that would try repeatedly and
finally connect
in this mean time i want user to show what connection is about that point of

time..something like a progress bar..

Now as u suggested i am running the connection in seprate thread and storing
that in a
session.. i conect to the serlvet each and everytime retreive the session
and then
check the thread display the same to user.. this is working fine..

Any how thanks for your Suggestion,,

Ganesh







-----Original Message-----
From: Geeta Ramani [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 12, 2001 5:48 PM
To: [EMAIL PROTECTED]
Subject: Re: Monitoring Servlet service ?


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

___________________________________________________________________________
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

Reply via email to