JSF 2.0 New Features

JSF 2.0 proposal has been posted on March 2007 and planned for the release in last quarter of 2008. It will be shipped with JEE 6.0 release. Looking into the features lits of the JSF 2.0, it is added lots of interesting features in the list and also they are aiming to attract more new developers to use JSF technology.

JSF 2.0 Features

Some of the interesting features includes Bookmarking for URLs, expanding the existing lifecycle mechanism, more support for the AJAX requests, use annotations instead of faces-config.xml, introducing JSFTemplating concepts and much more. It seems the list size is big it will be great to see when the final version is released. Basically it is categorized into four parts: Ease of development, New Features, Performance and Adoption. We will look into the each category with brief explanation. This tips based on the JSR 314 and the features list is taken from the original JSR document.

Ease of development

  • 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.

New Features

  • 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.

Performance

  • 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

  • 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.
转自:http://www.javabeat.net/tips/116-new-features-in-jsf-20.html

原文地址:https://www.cnblogs.com/lanzhi/p/6469905.html