In association with heise online

26 April 2010, 09:40

JSF implementation Apache MyFaces 2.0 released

  • Twitter
  • Facebook
  • submit to slashdot
  • StumbleUpon
  • submit to reddit

Apache MyFaces Logo Nine months after final approval of the definitive version of the JSF 2.0 specification (JSR 314) in July 2009, the final version of the Apache implementation MyFaces 2.0.0 has now been released. Probably the most important change is the introduction of Facelets, a view handling technology, into the JSF standard. New too, is the concept of view declaration languages (VDL), which allows such languages to be integrated in a simple, standardised manner. Java Server Pages (JSPs) are now seen as obsolete, a fact which finds expression primarily in the fact that no new VDL-related functions are implemented for JSPs.

The inclusion of AJAX in the JSF 2.0 specification is another significant change – previously it was left to developers to wed AJAX with JSF. This is the first time a JavaScript library has been a fixed component of the specification. All JSF components can now be executed using the jsf.ajax.request() JavaScript function or <f:ajax> AJAX requests. These requests are handled specially on the server-side, and only component parts of relevance to the request are processed.

A new feature which will bring a smile to the face of every Java developer is the project stage variable. This system variable, which is comparable with RAILS_ENV in Rails, tells the framework what stage the project is at. Permissible values are Development, Production, SystemTest and UnitTest. If, for example, the project stage is set to Development, the developer can access extended debugging and error information.

Composite components are also new. They allow developers to easily generate a complete JSF component from a single Facelet file. This eliminates one of the major criticisms of JSF – the complexity of component generation.

A further new feature of MyFaces 2.0 is the ability to save URLs as bookmarks. Previously, all JSF queries were POST requests. The introduction of <f:viewParam> allows request parameters to be treated like entry components and <h:link> and <h:button> make it possible to work exclusively with GET requests.

Standardised APIs for error handling and for loading resources, new metadata-based validation (bean validation) and the introduction of system events have also been added. The navigation mechanism has been expanded, storage of all component statuses improved and scopes have been beefed up with the addition of view and flash scopes. In order to reduce XML configuration work, the development team has also added numerous annotations. It is, for example, now possible to configure a managed bean with a scope session using @ManagedBean and @SessionScoped.

(Jakob Korherr, Apache MyFaces Committer)

(Jakob Korherr / crve)

Print Version | Send by email | Permalink: http://h-online.com/-985860
 


  • July's Community Calendar





The H Open

The H Security

The H Developer

The H Internet Toolkit