Tough in space?, <a href="http://tjws.sf.net" target="_blank" rel="nofollow">Get J2EE servlet container under 150Kbytes here</a><br />Love your iPod and want it anywhere?<a href="http://mediachest.sf.net" target="_blank" rel="nofollow">Check it here.</a><br /><a href="http://7bee.j2ee.us/book/Generics%20in%20JDK%201.5.html" target="_blank" rel="nofollow">Curious about generic in Java?</a><br /><a href="http://7bee.j2ee.us/bee/index-bee.html" target="_blank" rel="nofollow">Hate ant? Use bee.</a><br /><a href="http://7bee.j2ee.us/addressbook/" target="_blank" rel="nofollow">Need contacts anywhere?</a><br /><a href="http://searchdir.sourceforge.net/" target="_blank" rel="nofollow">How to promote your business with a search engine</a>
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 ?
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.