I am trying to implement AJAX in my Google App Engine application, and so I am looking for a good AJAX framework that will help me. Anyone has any idea?
I am thinking about Google Web Toolkit, how good it is in terms of creating AJAX for Google App Engine?
Here is how we've implemented Ajax on the Google App Engine, but the idea can be generalized to other platforms.
We have a handler script for Ajax requests that responds -mostly- with JSON responses. The structure looks something like this (this is an excerpt from a standard GAE handler script):
The commands are a simple implementation of the command pattern:
On the client side, we create an Ajax delegate. Prototype.js makes this easy to write and understand. Here is an excerpt:
to call the delegate, you do something like:
I hope this helps!
I'm currently using JQuery for my GAE app and it works beautifully for me. I have a chart (google charts) that is dynamic and uses an Ajax call to grab a JSON string. It really seems to work fine for me.
In my blog I deal with an easy way to do this - the link is: AJAX with Google App Engine. I include all the javascript and python code I used.
try also GQuery for GWT. This is Java code:
Being Java code resulting in somewhat expensive compile-time (Java->JavaScript) optimizations and easier refactoring.
Nice, it isn't?
Google has recently announced the Java version of Google App Engine. This release also provides an Eclipse plugin that makes developing GAE applications with GWT easier.
See details here: http://code.google.com/appengine/docs/java/overview.html
Of course, it would require you to rewrite your application in Java instead of python, but as someone who's worked with GWT, let me tell you, the advantages of using a modern IDE on your AJAX codebase are totally worth it.
If you want to be able to invoke method calls from JavaScript to Python, JSON-RPC works well with Google App Engine. See Google's article, "Using AJAX to Enable Client RPC Requests", for details.