aspose file tools*
The moose likes Servlets and the fly likes Intelligent client browser!!! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Intelligent client browser!!!" Watch "Intelligent client browser!!!" New topic
Author

Intelligent client browser!!!

Ashutosh Uprety
Ranch Hand

Joined: Nov 30, 2000
Posts: 39
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 ???
sebastien GUERLET
Greenhorn

Joined: Jun 28, 2001
Posts: 13
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.
Steve Chernyak
Ranch Hand

Joined: Oct 19, 2000
Posts: 113
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
Maky Chopra
Ranch Hand

Joined: Apr 11, 2001
Posts: 149
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.
Glen Tanner
Ranch Hand

Joined: Apr 16, 1999
Posts: 147

There is a way....Pushlets
[This message has been edited by Glen Tanner (edited June 28, 2001).]
Jason Menard
Sheriff

Joined: Nov 09, 2000
Posts: 6450
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
Glen Tanner
Ranch Hand

Joined: Apr 16, 1999
Posts: 147

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.
Ashutosh Uprety
Ranch Hand

Joined: Nov 30, 2000
Posts: 39
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Intelligent client browser!!!