• Post Reply Bookmark Topic Watch Topic
  • New Topic

Can servlet send messg/data to applet by itself  RSS feed

 
Vijay Kumar Vankadara
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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???
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!