wood burning stoves
The moose likes JSF and the fly likes Pushlets vs AJAX Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Pushlets vs AJAX" Watch "Pushlets vs AJAX" New topic

Pushlets vs AJAX

Michael Moser

Joined: May 14, 2004
Posts: 28
We use pushlets with some success for our dynamic HTML updates in a web application. Specifically, anytime new alerts are added to a database table, the JSP frame we use to display them realtime is updated. I know very little of AJAX apart from the buzzword. Can this tech help me reduce the overhead involved with pushlets?

[ April 04, 2006: Message edited by: Ilja Preuss ]
Linda Walters
Ranch Hand

Joined: Apr 30, 2005
Posts: 100
Probably not, since the main thrust of AJAX is "Pull" rather than "Push". The user performs some action, such as dragging an item to her shopping cart. The AJAX JavaScript code then sends the data for the selected item in a POST to the webservlet and the user can go on shopping or whatever. When the webserver returns the result (extended price, subtotal, sales tax, shipping, etc.) the listener that has been set in the AJAX app's JavaScript is invoked, the XML in the result is parsed for the data and then the existing DOM is modified by the JavaScript to replace and/or add the data from the XML to the existing form on the webpage.

Note that the possibly extensive HTML for the form itself is not resent to the browser, nor is the browser screen repainted, the data in the form widgets (or any other HTML elements on the page) are changed with a user experience that is much more like a desktop application.

I don't see any reason why the Pushlet and AJAX can't work together.

<a href="http://labryssystems.net/pblog/index.php" target="_blank" rel="nofollow">Javaville Gazette</a><br />Non-cooperation with evil is a duty. -- Mahatma Gandhi
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
Dont know, if you are thinking to replace your Pushlets with AJAX. No, you can't do that, as described in previous post.

As Linda already said, you can use both and AJAX would, definitely, add some real values.
Eric Pascarello

Joined: Nov 08, 2001
Posts: 15385
There is a new technique called Comet.

Michael Moser

Joined: May 14, 2004
Posts: 28
Thanks all for the comments! I have some new things to try now.
Just van den Broecke

Joined: May 25, 2006
Posts: 1

I just released Pushlets v2.0.2 which has support for AJAX through a JavaScript library. So I don't think it is either Pushlets or AJAX. So check it out: www.pushlets.com
An example is www.geotracing.com where Pushlets (w. AJAX) are used for real-time GPS tracking on a Google Map.

I agree. Here's the link: http://aspose.com/file-tools
subject: Pushlets vs AJAX
It's not a secret anymore!