Topic: updating website dynamically from server (java/php/ajax) (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=30590" title="Pages that link to Topic: updating website dynamically from server (java/php/ajax) (Page 1 of 1)" rel="nofollow" >Topic: updating website dynamically from server (java/php/ajax) <span class="small">(Page 1 of 1)</span>\

 
GRUMBLE
Paranoid (IV) Mad Scientist

From: Omicron Persei 8
Insane since: Oct 2000

posted posted 10-08-2008 11:31

hello,

i want to connect a website to a javaprogram running on the server.
that is, if the javaprogram has something to say, all the users that are currently viewing a website are provided with that message.

how can i accomplish that? i can easily do a php-java-rmi bridge but how can i send the update to the client?

thanks!

Tyberius Prime
Maniac (V) Mad Scientist with Finglongers

From: Germany
Insane since: Sep 2001

posted posted 10-08-2008 11:52

Hm... I'd suggest ajax based polling to a php script that returns the output. You just regularly do a request, see if it has any message, if so, display the message.

GRUMBLE
Paranoid (IV) Mad Scientist

From: Omicron Persei 8
Insane since: Oct 2000

posted posted 10-08-2008 12:07

ok, that might be an option. thanks!

but is there any way that the server notifies the website? i am asking, since the updates are coming very irregularly.

esskay
Bipolar (III) Inmate

From:
Insane since: Jan 2005

posted posted 10-09-2008 04:29

The issue is not with notifying the "website" but with notifying the visitors viewing the website. A user's web browser client connects to the website server, requests a document, then disconnects and shows the document to the user. While in this disconnected state, there is no way to PUSH information to the user. The user must PULL it from the website. That's where "polling" comes in. It can be done with AJAX as described. It could be done in Flash. It could be done with simple meta refresh timers. But one way or another, the user's client must initiate the conversation - the server cannot force the issue.

HTH,
- SK

GRUMBLE
Paranoid (IV) Mad Scientist

From: Omicron Persei 8
Insane since: Oct 2000

posted posted 10-11-2008 11:49

thanks for the info!

i actually thought that this is the situation where AJAX comes in. i mean how does gmail-ajax-application get notified by the server when new mail arrives?

twItch^
Maniac (V) Mad Scientist

From: Denver, CO, USA
Insane since: Aug 2000

posted posted 10-13-2008 16:24
quote:
i actually thought that this is the situation where AJAX comes in. i mean how does gmail-ajax-application get notified by the server when new mail arrives?



Among the many Javascript processes that are running for Gmail is one that queries the server every minute or so to see if there's new mail to display. If there is new mail, the script refreshes the inbox and displays the new message. I suppose this could be AJAX, but I don't know if any XML is used.

-S

Tyberius Prime
Maniac (V) Mad Scientist with Finglongers

From: Germany
Insane since: Sep 2001

posted posted 10-13-2008 21:36

there is a technology called 'comet' that tries to achive what you want (keep connection open, the the webserver can 'push' data when/if it occurs).
But it's still in it's infancy as far as support and reliability is concerned, I believe.



Post Reply
 
Your User Name:
Your Password:
Login Options:
 
Your Text:
Loading...
Options:


« BackwardsOnwards »

Show Forum Drop Down Menu