Tuesday, October 24, 2006

AJAX and server side scripting

I ran across this page at the sun developer site. It has a very nice run down of various AJAX design strategies. (Ref: http://java.sun.com/developer/technicalArticles/J2EE/AJAX/DesignStrategies/?feed=JSC). This is a good read not just for Java developers but anyone. The principles in it apply toward the development of any architecture in any language implementing AJAX.

In reviewing this document I came across a project again that interested me and spent some time playing with it on our app server (glassfish this time). This is the Phobos project (Ref: https://phobos.dev.java.net/). It basically allows for the use of javascript (and later other scripting languages like hopefully Groovy) to be used on the server side. JSP and JSF use tags to embed Java code into pages that are rendered server side. Phobos extends this to javascript with the concept of "ejs" files which embed javascript into the page for server side rendering. The benefits to an AJAX implementation of javascript on both side are obvious. I do not know yet how well the server side javascript has access to the Java classes. Future integration with JMaki might also make future use of JMaki widgets in Phobos apps easy. How might one instance this into a remote domain though?

I am still curious if one could simply make a GET call to an app server that would render custom javascript in JSONP manner and return it to a script call of a page. In truth couldn't this be a servlet. A servlet responds to a GET call and can return just about anything. So one would seem to be able to make a servlet that returns JSONP. If the Phobos server could return JSON or JSONP as well as EJS rendered HTML that might open some interesting possibilities for remote access to widgets. This may be worth some investigation and comparison to some of our early GWT application experiments.

1 comment:

Brent said...

So, what have you noticed coming along as far as server side scripting on Grails?