• 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

AJAX Controller

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is it a good idea to couple the Controller pattern with AJAX applications ?
 
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What's current pattern are you using?
 
Author
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you referring to MVC?
 
Arun Ilangovan
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yeah. I am referring to MVC. The question is, is this a good idea to route all AJAX requests through a single controller ? Also, can this be a "Struts" controller, if we use Struts with AJAX enabled pages ?
 
Christian Gross
Author
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I hope you are not referring to a single instance of XMLHttpRequest. When using XMLHttpRequest you will want to use asynchronous mode, because in synchronous mode you can lock a browser if the response takes too long. If you are using a single instance then you have to wait before queuing another request, and that well, is not something you want to do.

The idea of using XMLHttpRequest as a controller is not a bad idea. In a way the Content Chunking pattern is a simpler version of that strategy. If you want to use Struts that is ok. But please, don't use the XMLHttpRequest as a sort of delegated controller model where struts remains in control.

OK?

Christian
 
Arun Ilangovan
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you Christian. This is exactly what I was looking for.
 
reply
    Bookmark Topic Watch Topic
  • New Topic