Skip to main content

Why should I learn JSF

Java Server Faces (JSF) is one of the presentation web frameworks in java. There is lots of others frameworks like Spring, GWT, Wickets, Struts. Today this post we ll discuss why JSF is more important then others.Here I am not criticize any frameworks. i just talking about JSF.  


In JSF 1.2 and previous version of JSF used JSP as a view declarative language and JSP life cycle is not matched with JSF and ajax requests. JSF 1.2 are complex to use and they have some short coming in feature.

But JSF 2 is completely changed the adapt lots of technologies, but still its support backward compatible.Its very easy to learn. More over JSF is center piece in Java EE 6 Spec. It means that what are the new components or specification introduced in Java EE 6 are seamlessly integrated into JSF. Because those components spec is designed for JSF in mind.


New Components / Specification added in Java EE6 spec

  • CDI 1.0 (Contexts and Dependency Injection)
  • Bean Validation 1.0
  • Java Persistence API 2.0
  • EL 2.2 (Expression Language)

Above spec is added in Java EE 6 and well integration with JSF. JSF comes with basic components of HTML User Interface (UI). JSF is extensible. So with help of third party libraries like PrimeFaces, IceFaces, ADF Faces, ...   gives Rich UI.

When JSF 2 spec is gives direct competition to other web frameworks. JSF derive lots of good feature from Spring, GWT, Seam Framework.

 Why should I learn JSF

  • JSF spec is controlled by JCP (Java Community Process) and its standard for Java EE server
  • There is no vendor locking, because JSF is spec, we can use any implementation of JSF, for example MojarraMyFaces are JSF2.0 implementation.
  • JSF is part of Java EE 6. so when your server is Java EE 6 compliant server. then its must support JSF 2. so no need to configure externally and no need to put web framework jar in class path.
  • In Java CDI is direct compete with DI in Spring and Guice in Google . In JSF 2 Navigation Component is compete with Spring Web Flow. JSF 2's Ajax Framework components compete with GWT. so what i conclude here, each and every component is good/best
  • In JSF 2 is easy to implement with help of annotation. Annotation is makes all configuration files are optional. No more XML. Now Spring start supporting annotation instead of XML configuration.
  • Java EE components like CDI, Bean Validation, JPA are standardized and used in Enterprise Level and Java SE also. But other frameworks components are de-facto standard.



  • Java EE 5 had a big gap for enterprise application so we need those frameworks to fill the gap. but Java EE6 mostly fill the gap. If your working in Java EE 5 compliant server then you should go with those frameworks.  
  • If you take case study of JPA, before JPA come into picture, EJB 2.1 use persistent entity classes for persistent. its very difficult to study. Then Spring comes with easy solution POJO class used for persistent.  then JPA comes with improved solution with help of annotation. Now JPA is standard for all ORM libraries like Hibernate, EclipseLink,  etc.. Now EJB 3.1 uses JPA 2.0 is persistent purpose.
  •  Now Spring start support for CDI, Bean validation and other components in Java EE 6
  • Even you can easily integrate JSF pages in Spring 
If anything i mentioned wrong please put your thought in comments.


Please Check  Understanding Java Server Faces 2.0 Part 1
                                     Understanding Java Server Faces 2.0  Part 2 






Popular posts from this blog

Docker : Tomcat Clustering with Load Balancer (Tomcat and Nginx)

In this post i will show Tomcat Clustering in Docker Container. In  my previous post i discussed how to achieve tomcat clustering with Nginx Front end . Its almost same scenario, but this time we will achieve via docker container. Docker Docker  is an  open-source  project that automates the deployment of  applications  inside  software containers , by providing an additional layer of abstraction and automation of  operating-system-level virtualization  on  Linux . [4]  Docker uses resource isolation features of the Linux kernel  such as  cgroups  and kernel  namespaces  to allow independent "containers" to run within a single Linux instance, avoiding the overhead of starting and maintaining  virtual machine   --Wikipedia

Understanding Virtual Host Concept in Tomcat

Hi in this post we will see how to setup virtual host in Apache Tomcat server. Virtual Host is in-built feature that allows to deploy multiple website(domains) in single instance of tomcat server. The main benefit in this way is its cost effective. Scenario: I am going to deploy 3 website with following domain names in single tomcat http://www.ramki.com http://www.krishnan.com http://www.blog.ramki.com The following diagram is my outline. Outline structure of Virtual Host Concept in Tomcat Here my tomcat IP address 192.168.1.15. or any IP address allocated my ISP. but it should be public IP address. How all domain names are pointing to my Tomcat?                   When we purchase the domain name we need to update the our tomcat IP address to it. like or we can simulate same DNS Setup through hosts file in both Linux and Windows. In Linux tha file is located at /etc/hosts Now How Setup...

Virtual Host + Apache httpd server + Tomcat + mod_jk connector

In my last post ( Virtual Host in Tomcat ) we discussed about how setup the virtual host in Tomcat. Its cost effective technique because only one public IP is enough to host multiple domain. If we have big organization and each department want to host their website in locally in different machine. then how to achieve the virtual host concept?. In this post we will see the how we do this. Update :   I posted  Virtual Host + Nginx + Tomcat  Its easy to configure, compare to Apache httpd server Problem Scenario:         In big organization they have multiple department, each department want to host their website in different machine. so these websites are accessed locally with different local IP address. When we mapping to public address then we face the problem. We have two choice either purchase as many public address or Put one server front  and delegate these request. ...