Wednesday Mar 14, 2007

Next Gen Web @ JavaOne

Follow up from my previous entry, here is a complete list of all the next generation Web application, a.k.a "Web 2.0", sessions from Sun.

Session # Title
BOF 6012 JavaScript Programming Language Best Practices for Developers on the Java Platform
TS 6029 Beyond Blogging: Feeds in Action
TS 6375 jMaki: Web 2.0 App Building Made Easy
TS 6381 The Future of the Java Technology Web Tier
TS 6411 JSR 311: The Java API for RESTful Web Services
BOF 6412 Describing RESTful Applications: WADLing with Java
BOF 6424 Accessibility for Ajax and Web 2.0 Applications, from Emerging Concepts to Practical Coding
BOF 6425 Testing Web 2.0 Features, Using Real-World Applications
BOF 6807 Real-World Comet-Based Applications
BOF 6876 Ajax and Web 2.0 Performance Roundtable
TS 6957 Project Phobos: Server-Side Scripting for the Java Platform
TS 8840 Services Interoperability with Java Technology and .NET: Technologies and Tools for Web 2.0
TS 9516 Using jMaki in a Visual Development Environment

There is more content that has not been publicly announced yet. And while we are working on making presentations for this year richer, fuller and more hands-on, get your self familiar with JavaOne 2006 archives on this topic.

Session # Title
TS 1161 Evolving JavaServer Faces Technology: AJAX Done Right
TS 1222 RESTful Web Services With JAX-WS
TS 1615 Java EE 5 BluePrints for AJAX-Enabled Web 2.0 Applications
TS 1756 Java Technology and REST: Implementing the Atom Protocol
TS 3577 Using the Dojo Toolkit to Develop AJAX-Enabled Java EE Web Applications
TS 4372 Java Technology, AJAX, Web 2.0 and SOA
TS 8614 AJAX & Persistence: Emerging Patterns & Pain Points

Technorati: Javaone Web2.0 Ajax jmaki REST JavaScript

Tuesday Mar 13, 2007

Sun @ The Server Side Java Symposium

Here is the list of Sun Microsystems sessions at The Server Side, Java Symposium, Las Vegas next week:

Stop by and say hello to the folks who bring you this great technology!

Technorati: TheServerSide LasVegas Venetian Web services NetBeans Ajax JRuby Ruby GlassFish Sun presos

Monday Mar 12, 2007

Introducing Sun Web Developer Pack

Sun Web Developer Pack (SWDP) is a new integrated toolkit from Sun Microsystems that consists of a collection of Web 2.0 technologies that enable next generation Web application development. The toolkit consists of binaries, tutorial, documentation, samples (including source) to build your Web 2.0 applications and deploy them on industry-grade containers. It includes support for building rich user interface using Ajax technologies with Project jMaki & Project Dynamic Faces, light-weight Web services with Atom / REST APIs / WADL and server side scripting with Project Phobos.

Check the system requirements to see the list of supported platforms, JDK versions, browsers, web containers and Ant. These applications can be hosted on Sun Java System Application Server 9.x, Sun Java System Web Server 7.0 U1, GlassFish v1 UR1, GlassFish v2 and Apache Tomcat 6.

SWDP comes with NetBeans plug-ins that simplifies the design and development of Rich Internet Applications. These modules can be downloaded from NetBeans Update Center Beta with the name "Sun Web Developer Pack R1". Check out how to build jMaki and Phobos applications in a screencast.

Get the Sun Web Developer Pack
Simplify development of your Web 2.0 applications with this all-in-one download.

You can download SWDP as a stand-alone bundle and install on a supported Web container.  Alternatively, you can download SWDP bundled with Java Application Platform SDK Update 3 Preview. The SDK bundle can be downloaded in three different flavors:

  • Only SDK - Need to download JDK and NetBeans separately
  • SDK + JDK - Need to download NetBeans separately
  • SDK + NetBeans Enterprise Pack 5.5.1 Beta - Need to download JDK separately

After installing SWDP, it's recommended to view the latest online Release Notes. The binaries are accompanied by a comprehensive tutorial and an SWDP forum to post your questions. You can also view the list of SWDP bloggers or subscribe to the aggregated pipe.

You can view and download demos, samples, widgets and much more using these technologies here. Blueprints provide you guidelines and code for building these applications.

Technorati: swdp web2.0 ajax scripting javaee javaeesdk glassfish jmaki phobos netbeans

Friday Mar 02, 2007

JSON Pros and Cons

Following up on my JSON blog, here is great table summarizing the strengths and weaknesses of JSON as compared to XML.

Technorati: XML JSON Web2.0 Ajax

Sun @ Ajax World

Sun Microsystems is a silver sponsor of AJAX World Conference and Expo East 2007, Mar 19-21, New York City. Ajax Architect Greg Murray, Struts creator Craig McClanahan, and Jean Francois Arcand of Grizzly fame, all from Sun, will be speaking. Here are the topics:

It seems the conference planners really like Greg a lot since they've not only featured him on their main page but given his brief bio thrice :) 

And his last name is "Murray", not "Murry".

All of them are great speakers. So if you are planning to attend Ajax World, I highly recommend their talk. You'll see/feel the passion. 

Technorati: Ajax Web2.0 Sun AjaxWorld presos

Thursday Mar 01, 2007

Language-neutral data format: XML and JSON

XML and JSON are the two prevalent choices for language-neutral data format. That means a format used to exchange data between client and server, independent of the language used on each end. We are familiar with XML pointy bracket syntax which has served us well so far. With Rich Internet Applications becoming more common, there is a need to have a light-weight data interchange format. And so JSON is catching up (11% for data transfer in 2006).

Basically, JSON is built on two structures:

  • A collection of name/value pairs with unique names (associative array)
  • An ordered list of values (array)

See message samples formatted in JSON and equivalent XML. Tim Bray summarizes when to use which format.

Here is a collection of interesting articles in case you want to dig deeper:

The key advantages of JSON I derived from my reading of the above articles are:

  • Much simpler than XML because it is not a markup language and a natural representation of data.
  • JSON is better data exchange format, XML is a better document exchange format. 
  • JSON is easier to read for machines with no/thin client-side library.
  • JSON is a natural fit for data consumption by browser clients, for example Ajax components.
  • Ability to represent general data structures: records, lists and trees.
  • Wikipedia entry for JSON reports parsing and generating JSON support in 21 languages.

There are some disadvantages as well:

  • JSON format is hard to read for humans; for example complicated-looking syntax, like the }}]} at the end of data snippet is frightening and debugging pain.
  • JSON is a newer format so not enough tools to help with authoring & parsing. Some available are:
    • JSON Tools - Java Tools for the JSON Format (parser, renderer, serializer, mapper, validator)
    • JSON-lib - Java library for transforming beans, maps, collections, java arrays and XML to JSON and back again to beans.
    • JSON in Java - Java APIs from (see more below)
    • JSON-taglib - JSON-taglib is a JSP 2.0 tag library used to render JSON data from within JSP code.
    • Could not find an editor that would allow me to edit JSON objects.
  • JSON does not have a <[CDATA[]]> feature, so it is not well suited to act as a carrier of sounds or images or other large binary payloads.
  • Unlike XML, JSON does not provide any display capabilities because it is not a document markup language. JSON was not even intended for that purpose.
  • JSON is not extensible - it does not need to be because it's not a document markup language.

In jMaki, we use JSON in Java. Here is a sample code to create a JSON object using these APIs:

import org.json.\*;

public class JSONSample {
  public static void main(String[] args) throws Exception {

    // basic object creation
    JSONObject person = new JSONObject();
    person.put("name", "duke");
    person.put("age", "10");

    // how to create array and write to a "writer"
    JSONObject address = new JSONObject();
    JSONArray array = new JSONArray();
    array.put("4140, Network Circle";);
    array.put("Santa Clara";);
    array.put("CA - 95054";);
    address.append("address", array);
    OutputStreamWriter osw = new OutputStreamWriter(System.out);

    // XML->JSON conversion
    JSONObject likes = XML.toJSONObject("<likes><running/><skiing/></likes>");

And here is the corresponding output:

{"address":[["4140, network circle","Santa Clara","CA - 95054"]]}

This API also allows conversion from comma-delimited text, HTTP, Cookie, and CookieList to JSON conversions. The source code for JSON in Java is freely available but here are two suggestions for ease-of-use:

  1. Provide a jar file that is ready to use
  2. Publish the link to framed version of javadocs on the main page since that is more useful.

In summary, XML is document-oriented and JSON is data-oriented. So if you want to deal with highly structured documents that requires a complex structure, binary data, exact ordering of elements and be able to render itself then use XML. OTOH, if you are focused on light-weight data exchange then JSON is the way to go. 

Follow the JSON blog and enjoy!

Technorati: XML JSON DataFormat JavaScript Web2.0 Ajax jMaki

Monday Feb 26, 2007

Sun-internal jMaki Day Review

Last Friday jMaki team, at Sun Microsystems, arranged a jMaki Day for Sun-internal audience. The day was planned to introduce the technology and explains it's nuts and bolts with hands-on experience. Even though nobody outside Sun could attend it, but all the presos and lab material is available here

The morning sessions gave an overview of jMaki and included: 

The afternoon was BYOL (Bring Your Own Laptop) hands-on-labs and discussion with the team. It included:

The slides for the morning session and hands-on-labs are available. Here are some pictures:

Greg Murray



Carla Mott

Roberto Chinnici

Doris helping with mic

Ludovic Champenois

Greg Murray





You can get a flavor of these sessions and labs at Sun Tech Days

You can also view a collection of samples (run or download them) put together by Sun's Web 2.0 team. You can also look for a collection of jMaki samples here. All of these samples can be run on GlassFish.

Here are some important jMaki links:

Please send any feedback on slides and hands-on-labs to

Technorati: jmaki ajax netbeans glassfish presos

Monday Jan 08, 2007

FREE Ajax Codecamp - 2nd session

Sang Shin is starting the second session of "AJAX Programming (with Passion!)" from Feb 12th, 2007.

This FREE online course is for anyone who wants to learn Ajax for the first time or increase their knowledge on Ajax. In this course, students learn basic concept and technologies of Ajax such as JavaScript, CSS, and DOM as well as how to use various Ajax frameworks and toolkits such as Dojo toolkit, jMaki, Direct Web Remoting (DWR), Google Web Toolkit (GWT), and Ajax-enabled JavaServer Faces (JSF) components, DynaFaces, ZK framework, etc.

Each topic is accompanied by a hands-on lab in which NetBeans ready projects are provided so that attendees can readily build and run various Ajax applications with minimum effort.

For registration and other course related information, please go to the websites below. (Course home site) (Topics) (Registration) (FAQ) (Graduates)

Technorati: Ajax codecamp Dojo Google Web Toolkit Java Server Faces Programming Web2.0 Web 2.0 Web20 NetBeans presos

Sunday Dec 31, 2006

Goodbye 2006, Welcome 2007

Last day of 2006 and a lot got accomplished, either directly or indirectly, during the year:

On a personal front ...

This is by no means an exhaustive list of accomplishments either by Sun Microsystems or any other group within Sun. This is only an attempt to capture how and where I spent my time last year. There are still miles to go and a lot to be done. Today is the last day of 2006 and I'm ready for 2007.

Welcome 2007 and a very happy new year!!!

Technorati: HappyNewYear 2006 2007 WSIT GlassFish Marathon Ajax JAX-WS NetBeans

Wednesday Dec 13, 2006

jMaki: AJAX Framework

In a previous blog, I talked about AJAX. You can read about different AJAX design strategies, their pros/cons and when to use. This blog introduces you to jMaki.

Originally the project, jMaki, started as a wrapper for existing AJAX frameworks giving access to the JavaScript widgets from JSP pages or JSF components. And so the name, jMaki, where "j" is for JavaScript and "maki" is a Japanese word to "wrap" was sufficient. Even the logo for jMaki, a "j" as the cursive foot of the Chinese character meaning wrapper, was self describing. In that role, jMaki provides access to widgets from existing AJAX frameworks such as Dojo, Scriptaculous, Google Web Toolkit and Yahoo UI Library. A jMaki wrapper over several components from a variety of frameworks can be seen in this widget gallery. A more complete collection of widgets, organized by their framework, is available here. In the past few weeks, the project has transformed into a complete AJAX framework that provides a lightweight model for creating JavaScript centric AJAX-enabled web applications using Java (Java Server Pages and Java Server Faces), PHP 5.x, and Phobos (another of Sun's Web 2.0 offering, more on this later).

jMaki framework, as explained earlier, decouples the presentation logic and underlying data using Widget Model, Client Services, Layouts and Client Runtime on the presentation layer (a.k.a. Client Side Components) and Server Side Runtime and XmlHttpProxy on the data layer (a.k.a. Server Side Components). The original intent of the project, wrapper for existing AJAX frameworks, is now served by the Widget Model.

After reading all the details, it's time to try some code. Before you begin, I recommend watching this screen cast that introduces you to jMaki and walks you through the steps of developing a web application using jMaki plug-in in NetBeans. Using the screen cast, here are the steps that I followed:

  1. Download NetBeans 5.5.
  2. Download the NetBeans Ajax Update Center Module. I preferred the update center module over the jMaki plug-in NBM file (NetBeans module) as that allows me to download any related goodies (such as Phobos plugin) as well.
  3. Install the downloaded plug-in following the instructions. The updated AJAX Update Center module screen shot is available here.
  4. Create the web application following the steps in screen cast. 
  5. NetBeans 5.5 comes pre-bundled with Apache Tomcat  5.5.17. Go to the "Runtime" tab of NetBeans IDE (default short cut is Ctrl + 5), select the "Bundled Tomcat (5.5.17)", right click and select "Start" to start the Tomcat.
  6. Just for fun, I added the SuDoKu widget.
  7. Once the application is deployed (in step 4) then it can be viewed at http://localhost:8084/WebApplication1 (8084 is the default port, WebApplication1 is context root of your application).

And, with these steps, I could develop a simple rich internet application in few minutes. Once all the configuration is setup, it would take less than a minute to add a pre-built jMaki widget into your web application.  The beauty of using JavaScript is that once the web application is deployed, adding new widgets to the page is drag-drop-save-refresh cycle, there is no separate deployment cycle.

Sang Shin (of fame) has created a great hands on lab that walks you through the basics of using jMaki widgets. In a later blog, I plan to talk about how to create a jMaki widget from scratch and wrap a widget from one of the existing toolkits.

Technorati: AJAX Sun Web 2.0 jMaki

profile image
Arun Gupta is a technology enthusiast, a passionate runner, author, and a community guy who works for Oracle Corp.

Java EE 7 Samples

Stay Connected


« July 2016