jQuery in Action, 3rd edition
The moose likes HTML, CSS and JavaScript and the fly likes Ajax & performance Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Ajax & performance" Watch "Ajax & performance" New topic

Ajax & performance

Vivek R Somani.

Joined: Jul 24, 2007
Posts: 1
it is known that using Ajax you can asychronously make calls to server with out reloading the whole page.

But what I have observed when using Ajax with faces (JSF) is that the whole page is submitted although the reloading happens for the specific part of the page. So how does really Ajax help in improving the performance?
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

Pages are not submitted.
Can you elaborate on what you meant by that?

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Rahul Bhattacharjee
Ranch Hand

Joined: Nov 29, 2005
Posts: 2308
AJAX is a client side component and it has a counter part at the serve side too.Using javascript objects it communicates to the server counterpart requesting for data and once the data is available in the client side , it again with the help of javascript renders the data in the browser.

The whole point of AJAX is that page should not be submitted.Javascript would make a internal request to the server for data.The browser URL remains the same and the complete page doesn't refresh.
One more thing is just because you are using AJAX doesn't mean that its improving your applications performance.

Rahul Bhattacharjee
LinkedIn - Blog
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63870

Any such problem you encounter is a factor of JSF, not Ajax.

[Asking smart questions] [About Bear] [Books by Bear]
Alexei White

Joined: Jul 20, 2007
Posts: 14
I agree.. there may be a misunderstanding as to what should be happening with an AJAX request.

Ideally you make an AJAX request for a discrete piece of data.. like loading a page of records into a datagrid. The real advantage here is bandwidth. Even if the server runs through the entire execution lifecycle of the source document, the performance gain comes from
  • Fewer bytes transmitted
  • Client browser does not need to reinitialize the entire document (very slow)
  • Updates are made to the page via DHTML instead (very fast)
  • User gets to preserve their workflow, and page state overall.. which means more productivity for the user, and better perceived application performance.

  • Alexei White<br />Nitobi Software<br />-------------------<br /><a href="http://www.nitobi.com" target="_blank" rel="nofollow">www.nitobi.com</a><br />Enterprise Ajax Book <a href="http://www.enterpriseajax.com" target="_blank" rel="nofollow">http://www.enterpriseajax.com</a><br />f. 604.985.9287
    I agree. Here's the link: http://aspose.com/file-tools
    subject: Ajax & performance
    It's not a secret anymore!