Sun has posted an early draft review of Java Specification Request 314: JavaServer Faces 2.0. This makes various minor updates to support Java 1.5 features, align the spec with JAX-RPC 2.0, and support subsitution groups. According to the JSR:
Requirements are grouped into four major categories: Ease of Development, New Features and Fixes, Performance, Technology Adoption. Following are some initial requirements that will be prioritized and considered when the Expert Group convenes. Not all of these ideas will be in the final specification. Some of these requirements may be met in the Servlet specification (or other Java EE specification) but they are stated here because they are critical to the success of JavaServer Faces.
Ease of Development
While this was the major theme for Java EE 5, it was not the major theme for the version of the JavaServer Faces specification included therein. The act of writing JSF applications and components "by hand" will be made much easier by this JSR. Example requirements in this category include:
- Component aggregation. Allow development of custom component with little or no Java coding. [A] Perhaps consider a standard set of aggregations.
- Allow for "zero configuration" web applications. No faces-config.xml, no web.xml. If necessary, annotations will be used to supplement the configuration data.
- Vastly improve the developer experience with regard to error messages that happen during iterative development, and even during deployment of the application. For example the EG will consider options including, allowing the developer to tell the runtime what stage of development the web application is in, and take action accordingly: Development, Test, Deployment. Line precise error reporting. Pluggable Exception Handling.
- Provide default exception handling mechanisms. For example, all runtime errors get forwarded to an error page.
- Eliminate the need to author a JSP tag handler when writing JSF components.
- Leverage annotations to declare JSF artifacts (components, managed beans, navigation rules, etc) to the runtime.
- Declarative Renderers, otherwise known as Renderers without resorting to out.println().
- Real world, production view description technology, including templating: include something influenced by Facelets, JSFTemplating or Tiles in the specification.
- Make it very easy to create CRUD based applications.
There are also a number of container improvements that should be considered to improve developing web applications in general:
- Eliminate the "deployment step". All the artifacts that comprise a JSF application can be modified while the application is running. This will bring the responsiveness people have been used to with iterative JSP development to the JSF developer. One design idea for this is to allow JSF artifacts to be authored in Script.
- Expand the contract of the exploded WAR (and non-exploded WAR) to have knowledge of JSF artifacts. For example, define a place within the WAR structure for such artifacts as components, renderers, converters, etc. Having a concrete correspondence between the constituent parts of a JSF application and actual directories within a WAR will make it easier to understand an application and also map help with the elimination of the deployment step.
New Features
Requirements in this category stem from feedback from real world JSF users and are incremental improvements on the existing specification. This category includes fixes and updates to existing APIs. Example requirements in this category include:
- Expand the request processing lifecycle to be aware of Ajax. This may include describing a small developer-contract footprint JavaScript library as part of the JavaServer Faces specification.
- Separate the "build the tree" and "render the tree" processes into two separate lifecycle phases.
- Allow for partial tree traversel during lifecycle execution via Ajax.
- Allow for bookmarkable JSF pages. More broadly, if HTTP GET can be used, it should be used.
- Decent client side, inter-component and form-level validation (leveraging JSR-303 validation if possible).
- First class support for bundling and delivering static resources associated with a component: images, stylesheets, scripts, etc. Should be able to specify default locations for resources.
- Strategic additions to the Standard HTML RenderKit: Date Picker, Tree, Tab View, File Upload components.
- Provide a mechanism to minimize the "Lost Update" and "Duplicate Button Press" problems. These mechanisms must be pluggable or customizable from the user.
- Page actions: The ability to say, "when this page loads, invoke this action (via Ajax if necessary)."
- Provide a mechanism to easily access persistent store.
Runtime Performance and Scalability
The flexibility of the JavaServer framework can lead to performance concerns. Requirements in this category make modifications and restrictions to the specification to increase performance across the board for all implementations of the specification. Example requirements in this category include:
- Saving and restoring page deltas rather than saving and restoring the full view state each time.
- Re-do UIComponent state saving with a view towards making stateless components the default.
- Allow for moving as much of the event processing and inter-page component interaction into the client as possible. This may imply specifying client side controller framework.
- Streamline the rendering process via caching if possible.
- Improve the interceptor mechanism delivered via the PhaseListener feature so that the developer can control exactly what kinds of requests are allowed to be processed by each PhaseListener instance.
Adoption
Increasing the capability of the JavaServer Faces standard will continue to attract more people to write applications targeting the standard, thereby raising the bar for Java web applications. Features in this category aim to attract new developers to use products that implement the JavaServer Faces specification. Example requirements in this category include:
- Enable components to have a client based lifecycle in addition to, or instead of the server based request/response lifecycle. Such a client based lifecycle would enable use-cases such as drag-and-drop, master-detail and sub-dialogs on a single page interface web application.
- Improve the UIComponent specification to allow an increase in the interoperability of UIComponent libraries from arbitrary vendors.
- Enable applications to use features that are defined in the JavaServer Faces specification but are intended for use in the Java EE platform as a whole. For example, the managed bean facility is useful even in an application that only uses Servlets from Java EE but provides the rest of the web application features from software outside of the platform.
- Allow JSF application resources to be accessed via REST.
- Enable components that publish events via RSS/Atom.
- Add support for REST (JSR 311)
- Broad and pervasive support for scripting at all levels of the specification. It will be possible to use a scripting language to write all executable artifacts in a JSF application.
- Specify command line interface for authoring JSF applications.
- Support for passing values from page to page. This will be a standardization of the many different Dialog/Conversation/Scope/Flash ideas currently in use.
- "Skinning", or "Themeing" of components.
- An important target user for JavaServer Faces technology is the developer who relies on an Internet Service Provider (ISPv) to host their application, as well as hosting their development environment. It must be easy to iteratively develop a JavaServer Faces application that is hosted entirely on an ISP.
I've paid essentially no attention to JavaServer faces, but looking at the list of improvements for 2.0 what I'm struck by is how badly wrong they got version 1.0. I mean, they're just figuring out that GET and bookmarkable pages are a good idea now in 2008? Comments are due by October 16.