Mock tests, Interview questions, Tutorials and Tech news
 
 
Home > Programming / tutorials > JSF 2 – New features

JSF 2 – New features

In our last post , Getting started with JSF , we had covered JSF1.2.  JSF has come a long way from that.  JSF 2 has come with very new features, some of them taken from different frameworks / components.  Now JSF developers don’t have to look out. JSF2 helps JSF developers to keep their application simple.
There are many articles explaining new features of jsf 2. But here in this blog, I brief you some of the features:

1. The introduction of  View scopes, flash scope and custom scope - View scopes,Flash scopes and custom scopes are ‘bigger than request scope but smaller than session scope’. Many times developers are forced to keep objects in session scope just because they want the objects available till end of their front view operation or make them work in the redirection or till end of their front end operation.  For example you might have experienced implementing edit/delete/ add operations to datatable,  many times its necessary to make the bean session scope to make it working right way. This can be avoided by view scope variables. The custom scope helps objects to be available till end of user operation (user has to decide the scope of bean). This is like flow scope.Flow scopes were offered by frameworks like spring webflow etc .. But for an application already done in JSF, it is easier to shift to JSF2 than webflow.
2. The Ajax support from JSF core: Earlier Ajax support and components were provided by third party implementations. There was no support from JSF core. JSF 2 fulfills this.
3. Navigation is made easy. Concepts like, implicit navigation helps lesser xml definitions.

4. No managed bean configuration. (Only with spring there was such feature)

5. Direct use of #{}. Earlier if we wanted to output some data from bean to html, we had to do it by <h:outputText value=”#{bean.property}”>. But now we can use just ”#{bean.property}. Also jsf provides components to specify style sheets.

6. Support for get requests. New two components h:button and h:link are added, which will generate GET requests. Now there is no need to hardcoding url in outputLink.
7. Components can also specify client side behavior . Eg:asking confirmation before submitting a link/Button now can be specified in JSF without javascript.
8. Validations made easy.

Click here (http://jcp.org/en/jsr/detail?id=314) to check out for detailed specification document.

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Mixx
  • Google Bookmarks
  • IndianPad
  • Reddit
Categories: Programming / tutorials Tags: , ,
  1. Robby
    May 24th, 2010 at 10:45 | #1

    Nice overview! JSF 2 really is amazing :-) Best web framework of 2010 if you’d ask me.

  1. No trackbacks yet.
Get Adobe Flash playerPlugin by wpburn.com wordpress themes