tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benjamin Larchevêque <benjamin.larcheve...@teamtrade.com>
Subject The ChatServlet does not print anything.
Date Tue, 17 Apr 2007 16:30:12 GMT
Hi, I am trying to use the Comet feature in Tomcat 6. I think my APR connector is working since
I reach successfully the event() method, but when I launch the ChatServlet the page remains
the same for ages. Actually when I really reduce the code to something like:

--------------------------------------------------------------------
    public void event(CometEvent event) throws IOException, ServletException {
   	System.out.println("event.getEventType() = " + event.getEventType());
        HttpServletResponse response = event.getHttpServletResponse() ;
        PrintWriter writer = response.getWriter() ;
        writer.println("<html><head><title>JSP Chat</title></head><body>test</body></html>")
;
        writer.flush() ;
        event.close() ;
    }
--------------------------------------------------------------------

In debug mode, the word 'test' is only printed in my web page when I pass the even.close()
line... Is it normal? If it is, how can I loop to print anything after closing the event?
More generally, how can I choose my event type such as READ, BEGIN, CLOSE...

If someone could tell me what I am missing here...

--
  Benjamin Larchevêque
  Ingénieur Etude & Développement
  ----------------------------------------
   Team Trade Paris
   43, rue Taitbout
   75009 Paris
   +33 6 1955 6012
   benjamin.larcheveque@teamtrade.com

   http://www.linkedin.com/in/larcheveque

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message