Hello List

         Thanks for all the previous responses. Considering them all,
elaborated a smaller test to see what was happening.

         It seems that execution is not going through the sleep call,
although it is declared.

         It's easier to show the code (regarding lines prefixed with ==> ) :

import java.io.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.net.*;

public class test extends HttpServlet
  {

    public void init(ServletConfig tconfig) throws ServletException
      {
        super.init(tconfig);
      }

    public void service(HttpServletRequest request, HttpServletResponse response)
                throws ServletException, IOException
      {

        File ResponseFile = new File("c:/temp/output.htm");

==>     while (! ResponseFile.exists()) // before running I del c:/temp/output.htm
==>       {
==>         try
==>         {
==>           Thread.sleep(10000); // dont know why but execution
==>                                // never falls here
==>                                // athough I'm sure c:/temp/output.htm
==>                                // does not exist (dir while browser waits)
==>         }
==>         catch(InterruptedException ex)
==>         {
==>                                // nor here either
==>         }
==>       }                        // Would there be any problem
==>                                // with ResponseFile.exists() ??

        response.setContentType("text/html");
        PrintWriter os=response.getWriter();

        FileReader ret = new FileReader(ResponseFile);
        int c;

        while ((c = ret.read()) != -1)
          os.print((char) c);
        os.flush();

        ret.close();

      }
  }


       ThanXs again !





                                Obrigado/Thanks a lot,

                                Jose Adriano Baltieri
                                Analista de Sistemas
                                CPD - CENTRO
                                UNIMEP - Universidade Metodista de Piracicaba
                                PIRACICABA - SP - BRASIL
                                Fone : 055  019  430-1858 (english spoken)
                                Fax  : 055  019  430-1898 (Caixa Postal 42778)

___________________________________________________________________________
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