I need my servlet to send messages to the applets connected to it without any invocation from the applets. say by checking some flag or at certain time intervals.... Is it possible???
posted 14 years ago
No. Servlets work by HTTP, which is a request-response protocol. The requests have to be initiated by the applet side. There are some tricks you can try like holding the HTTP connection open on the Applet side and having the servlet periodically return another data set, but these are ENORMOUSLY wasteful on the server side; basically you tie up a thread per client. Your best bet is to poll on the applet side. It's not hard, and will meet your needs. Kyle