Report from JavaOne 2007 – The future of the Java Technology Web Tier

While still early days, and with the expert groups still having to do their job, this session discussed some of the likely advances for the Java Technology for the Web Tier we may be looking at with JEE 6. In particular the session spoke about Servlet 3.0, JSF 2.0, RESTful Web Services, Scripting and AJAX, while surprisingly enough it did not discuss JSP at all.

The major theme for JEE 6 is ‘ease of development’. Through better (options for) tool support, more configuration by exception and better default values.

Servlet 3.0

The Servlet specification was hardly touched since J2EE 1.4 (2004), so some might suggest it is about time something happens. One of the possible advances could be the use of annotations to declare servlets and servlet filters. These annotations may even render the web.xml file obsolete.....

We may see asynchronous support (supporting the Comet technology) on the server side:
– non blocking input/output
– delayed request handling
– delayed response close: long lived connection through which the serverc can keep pushing data to the client

In the security area Servlet 3.0 may have a login/logout facility – without requiring a full session invalidation, as well as a feature called self-registration. Servlet 3.0 will align with the changes in JSF 2.0 and on the REST API. Furthermore it will have support for such things as file upload, ordering of servlet context listeners, container wide definition of init-parameters and better welcome-file support.

JSF 2.0

Support for annotations to allow for much more declarative programming experience. Again, better default values. In so far as possible minimize or even eliminate the need for configuration files. Support for AJAX, which means changing the request processing lifecycle and enabling it to deal with partial responses for just a zone in a page rather than the entire page. Another interesting theme: make the development of JSF components easier (for example: do not require to implement as TagLibrary Handler that really could have been generated from the Component class file.

REST WebServices

The REST (REpresentation STate) services are an alternative to the full fledged SOAP WebServices. REST services are based on the HTTP protocol with a limited set of operations (CRUD). A URL represents a resource that can be accessed by REST over HTTP with four HTTP actions (POST, GET,..). There will be an API (JSR-311) focused on develing Java Based REST WebServices. Amongst other successful REST APIs, Java will have support for the ATOM Publishing Protocol, released later this month or so.

AJAX – jMaki, Phobos, DynaFaces

There is quite a lot happening with AJAX in the Java Platform. The jMaki project provides a wrapper for JavaScript libraries such as DOJO, Scriptaculous, Srpy en Yahoo, make them accessible as JSP tags or JSF components. There is tool support for jMaki in Eclipse and NetBeans (drag and drop usage of jMaki components in the page). There will also be support for using jMaki components in Ruby and PHP in addition to Java.

The AJAX oriented DynaFaces library for JSF 1.2 adds some sort of partial page rendering support – refreshing special zonesd in the web page – to JSF. DynaFaces extends the standard JSF lifecycle. It can be used by just adding a JAR-file to the JSF 1.2 compliant application server.

Comet

Comet provides an asynchronous model based on long-lived connections between browser and web server, allowing (web)pplications to deliver data to their clients at any time. This model is based on (plain old) http 1.1.

Feeds

Feeds, of which RSS feeds are the best known example, are frequently used to make an actual list of blog-entries available to RSS Feedreaders. However, the concept of a feed can be applied in a much broader sense. Any series of events really could be published as a feed. Java WebTier Technology will will implement the Atom Feed standard, soon to be specified as IETF standard. Already, there is open source project Rome, that can read and process RSS feeds. Rome and Abdera are both frameworks for consuming and producing rss-feeds.

Scripting

One of the hottest developments in the Java community, is the tidal wave of scripting langusages that hit us. From Perl, Groovy, PHP, JavaScript, the new JavaFX, Ruby, Python, there seems to be scripting language for almost every occasion. Scripting languages are dynamic, evaluated (interpreted) at runtime, typically deal with objects in a very flexible manner and on the whole can add domain specific functionality and solutions to Java applications. Some may suggest they can completely take over, in certain situations.

The J2SE 6 release has support for integrating scripting languages directly into Java programs. Support for Scripting languages in the WebTier initially focus on server side JavaScript, with support for other script languages following soon after JS. The Phobos project provides s light weight application framework for server side JavasScripting. It can for example communicate data that is read from the Model to the Client, expressed in the JSON format. The Phobos framework can be deployed on any Servlet 2.5 compliant Application Server, such as Glassfish V2 or Oracle AS 11g TP.

Sun Web Developer Kit

Available for download: http://developer.sun.com/web/sdwp. Contains: free integrated toolkit, Tutorial, Resources and includes software, for example: jMaki, DynaFaces, REST. Phobos, Rome.

And where is JSP 2.x?
The topic missing from this presentation was JSP, good old Java Server Pages. No references at all to where JSP is going – so you may be wondering whether it is going anywhere at all?