Thursday, May 18th, 2006

Sun Announces Ajax Widget Wrapping and JavaScript App Server

Category: Ajax, Java, JavaScript, jMaki

<p>Over the past week, Sun has made two very interesting announcements. First, at our own Ajax Experience event, Sun announced jMaki. Created by Sun’s Ajax guru Greg Murray, jMaki (Maki is Japanese for “wrap”) provides a simple API for embedding disparate JavaScript widgets into a Java web application.

jMaki is all about enabling Java developers to use JavaScript in their Java based applications as either a JSP tag library or a JSF component. jMaki uses the best parts of Java and the best parts of JavaScript to deliver a rich AJAX style widgets.

jMaki currently provides bootstrap widgets for many components from Dojo, Scriptaculus, Yahoo UI Widgets and DHTML Goodies. This project also includes a set of AJAX widgets with a focus on Web 2.0 such as a RSS widget, a del.icio.us Bookmark widget, a Chat widget, and many more to come.

We’re pretty excited by how jMaki can make it much easier to add Ajax to Java applications.

The other very interesting announcement is Phobos, a JavaScript-based application server for Java, created by Roberto Chinnici:

Project Phobos is a lightweight, scripting-friendly, web application environment running on the Java platform, aimed at addressing emerging developer requirements. Scripting and dynamic languages are growing in popularity among developers, especially for building Web applications. These developers place special value on rapid application development and deployment.

The goal of Project Phobos is to show that Java is an excellent platform for server-side scripting, allowing dynamic-language developers to leverage the power of Java SE and EE. The initial focus for Project Phobos is JavaScript, but the design supports the use of other dynamic languages as well.

Phobos uses Rhino, a Java-based JavaScript engine, and supports embedding JavaScript inside web page templates much like Ruby in Rails apps or Java in JSP apps. It’s a bit of a mind-bender to imagine JavaScript on the page executing in the client along side JavaScript executing on the server; even cooler: having the server-side JavaScript emit JavaScript eval’d on the client at run-time. Yikes!

Another eyebrow-raiser is that Phobos doesn’t reside within a Java EE container; its a stand-alone app server that competes (conceptually) with a servlet container. What is Sun up to?

We can’t help but be intrigued by the idea. So many of us are becoming JavaScript experts because of all the client-side work we’re doing; it sure is nice to be able to apply that knowledge to the server-side as well, and gaining tight integration with the rest of the Java platform as well as being able to compile the scripting code to bytecode for JIT compilation by the Java run-time sure is nice too (Phobos supports both interpreting JavaScript and compiling it).

Phobos is a research project that isn’t yet ready for download (because of licensing issues). Sun is also still working out the governance model for it. Look for another posting in a couple of weeks for more details.

Related Content:

11 Comments »

Comments feed TrackBack URI

Based on my reading of phobos.dev.java.net, Sun is providing the webapp server/servlet container – Glassfish. I guess advanced users can deploy Phobos to their own containers (though it will be harder on others I guess)

Comment by Migs — May 18, 2006

Scripting and dynamic languages are growing in popularity among developers, especially for building Web applications.

Growing? Arn’t scripting and dynamic languages already number one in the “web applications” area, and have been for a long time? How many developers use C to create their web sites?

Does anyone have any stats on language usage? I remember there being a site that did some rudimentary tracking back in the dotcom era, but don’t have any hard/useful numbers currently.

(BTW, the color of the blockquote + the background color of the comment preview makes it difficult to read the full preview text)

Comment by Andy — May 18, 2006

I believe that Netscape originally created LiveScript for its app server, then added it to the browser. At any rate, the ASP-equivalent scripting language for NES was LiveScript (later renamed to JavaScript).
So actually JavaScript is just coming around the full circle.

Comment by Skott Klebe — May 18, 2006

“It’s a bit of a mind-bender to imagine JavaScript on the page executing in the client along side JavaScript executing on the server;”

NOW you think so?
XIN is already doing this, and very effeciently so by the way too.
http://www.naltabyte.se/howto.htm
- Gezz..

Comment by Mikael Bergkvist — May 18, 2006

A while back I did a proof of concept of server side javascript using Rhino as the interpreter and Jetty 6 for the server. I tidied the code up and put it here:
http://www.bluishcoder.co.nz/2006/05/server-side-javascript.html

It demonstrates dynamically creating simple servlets from Javascript and adding them to a running server. The possibilities are definitely interesting.

Comment by Chris Double — May 18, 2006

Migs: Sun is using the Grizzly connector, the same connector that Glassfish uses, but Phobos is not deployed in a container at this time.

Comment by Ben Galbraith — May 18, 2006

[...] The Java Posse has been busy at JavaOne and recorded a couple of interviews on the high-profile Java+Ajax toolkits we’ve mentioned recently. Two Interviews about AJAX. The First is with Brett Taylor of Google about the just-announced red-pill project (also known as the Google Web Toolkit) and the second with Greg Murray of Sun … [...]

Pingback by Ajaxian » Java Posse Interviews: Google and Sun Toolkits — May 19, 2006

There is also helma which is a javascript web application server/framework (also using rhino as the javascript engine) which has been around for a number of years now…

Comment by Maksim Lin — June 7, 2006

Server side javascript? Back to the messy world again. Only stupid project manager will allow server side javascript be implemented. Broadvision implemented their commerce web apps using server side javascript and ask anybody who has to maintain them. It is the worst of the worst approach. I was in couple projects that convert server side javascript to j2ee. It was a costly lesson learn for those companies who hired us to do the clean up. Same thing with AJAX, good and fancy today but tomorrow it is worthless. It gets job done today that is for sure. Tomorrow, they are just pieces of javascript needed to be ported again to more structure type safe language or just throw them away. I am welcome all the mess smart alex built today because tomorrow it will be obsoleted and we get pay good money to clean it up. Wait till new brower comeout and all of this AJAX willbe thing of the pass. If AJAX is so hot surely future browser will expose API for us developers to get the same fucntionality without messy javascript.

Comment by beenthere — June 10, 2006

Server side JavaScript??
On the server you want to have a TYPED language, no matter how much I LOVE JS I would never even CONSIDER using it on the SERVER!!
On the Client Side it’s eactly what the doctor ordered, on the server it’s like a knee in your brain!
A knee is useful, but not when it’s mashing your brain… ;)

Comment by Thomas Hansen — March 11, 2007

Just a counterpoint here to the other comments. I’m very excited about the idea of JS on the server. Maybe it’s time has come.

Comment by Chris Anderson — July 6, 2007

Leave a comment

You must be logged in to post a comment.