• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

2 doubts in AJAX

 
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1) If the DataBase is taking lot of time to produce the results in Action class (depending on the results i want to set the values into XML) then,
automatically the AJAX response also will have to wait upto until the DataBase results comes.

So although using AJAX the user have to wait upto DataBase results comes to Action class

Is the AJAX right one to use in this case ?
Is the AJAX having solution for this ?

2) Can we set the Attributes into HttpServletRequest in Action , and reading those in JSP.
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There's nothing magic about AJAX. A call across the network to the database still takes exactly as long as it does with a traditional web application. The increase in speed comes from the fact that an AJAX call can just replace part of the data on the page rather than refreshing the whole page.

The "A" in AJAX stands for asynchronous, which means that when a request is submitted, the user gets back control and can perform other actions while the server is working. When the server returns a response, a callback function is called that uses the information returned to modify the page.

Because of this return of control, the response often seems faster to the user than it really is.

In answer to your question about whether AJAX is the right technology to use: I would answer that in about 98% of the time, the answer is no. Most of the tasks that a web application needs to do can still be best accomplished in the traditional way using the "display a page: submit a form" approach. However, AJAX can be very useful for the other 2 percent of cases. Examples:

* Auto-suggest boxes (User starts typing and a list of suggestions appears)
* Cases where the choices in a second dropdown box are dependent on the choice made in the first dropdown
* Cases where you want the user to be able to drag and drop something

2) Can we set the Attributes into HttpServletRequest in Action , and reading those in JSP.



No, you can't. It's a completely different paradigm. To understand how it works, google "ajax basic tutorial" and try it out.
[ May 23, 2006: Message edited by: Merrill Higginson ]
reply
    Bookmark Topic Watch Topic
  • New Topic