I have searched far and wide for an answer to this question: Is it a good practice to send AJAX requests to the controller of a web application?
For instance, my url’s point to the controller and pass in an action. That controller executes the action and forwards the request to a jsp page. But using AJAX I would set a few headers in the response and use the writer to send my XML or JSON text back to the client.
I just started a new job and they are doing something else with AJAX requests. They are sending the request to a jsp page which creates HTML, though setting the header to text, and it goes back to the client that way. I guess it works but it makes me squirm deep down inside and I need to know why so I can explain it to them and do it right. All the work I’ve done with AJAX has always involved JSON or XML returns and never a JSP intermediary. <shiver>
I am thinking of using JSON-RPC-JAVA as my AJAX controller. It’s good? IBM is promoting it, along with the dojo tool kit.
Any thoughts, ideas, resources would be escpecially helpful.
Thanks so much,
-Robert