We can generally write web pages which automatically refresh after some predefined time to show changes in data. How about this scenario ?? If I want to refresh the client page only and only when there is a change of data (and not after every 60 seconds), how to go about it?? Mind you, if the data is not changed at the server, then the client should not refresh itself. If not in JSP, then is there any other way of achieving this "intelligent refreshing capability" on the client browser ???
there is no way to do a such thing (called "push" I think) until you write your own client... which it seams to not be the case here. In fact, your server has to send a request to the web client but none of the market client (ie, ns,...) can hold this request as you want.
I had this issue come up before. We ended up just refreshing even if there was no chage, but these are the ideas we had: 1. use an applet (needs a plugin) 2. inside the jsp display general content, that will not change, call flush, and then call a blocking method that does not return until there is a change. We always expect there to be a change on the server. That is even if the data did not change we would time out after a certain period, and display the rest of the page. I am interested in hearing opinions about this apporach Thanks, Steve
I'm no good at applets but cant you have an applet refresh the entire html page ? If so.. have a 1 px * 1 px applet that acts as your client that quesries the server and once it detects the change, have it reload the page.
Originally posted by Glen Tanner: There is a way....Pushlets [This message has been edited by Glen Tanner (edited June 28, 2001).]
Great article. Thanks. Jason
Joined: Apr 16, 1999
You know, I think I spoke too soon. I played around with the Pushlet stuff for awhile, and it just doesn't seem like a very elegant solution to me. Besides, the code hasn't been updated for quite sometime. This could actually turn into a maintainance nightmare. The best solution I can come up with is still client side polling. I agree that is at least an interesting article though.
Joined: Nov 30, 2000
Even I went through the article. Yes it is impressive, but it just means too much load on the server, which is not a very good sign. Also SUN does not seem to ok this technique. There is something called "aglets" developed by IBM, which may form good reading. Anyway, if anyone gets anything on my original question, then pls do write.