Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between JSF and Facelets?

Tags:

jsf

facelets

I am following the Java EE6 tutorials and I don't understand the difference between JSF and Facelets. Chapter 4 goes has a section 'Developing a Simple JavaServerFaces Application' and Chapter 5 has a section 'Developing a simple Facelets' application and as far as I can see both these examples use the exact same process - an .xhmtl page for the markup, a backing bean to hold some data and then a web.xml file that maps urls to the 'FaceletsServlet'.

From what I can gather Facelets are .xhtml pages with tags such as <h:head> and <h:inputText> used to mark up the webpages.

But then what is JSF? I have read that either JSP or Facelets can be used with JSF so does that mean the role of JSF is to provide the tag libraries that are used by JSP or Facelets?

like image 996
Jim_CS Avatar asked Jul 12 '12 17:07

Jim_CS


1 Answers

  • JSF - Java Server Faces is the overarching application development framework. It contains many aspects, one of which is the view handler. JSF (Wikipedia), JSF (Stack Overflow).

  • Facelets is a view handler for JSF. Before JSF 2.0, JSP was the default view handler, but the problem was JSP didn't work very well with JSF's component based framework. Facelets was designed from the ground up to work well with JSF. Facelets (Wikipedia), Facelets (Stack Overflow)

Tag libraries are a different part of the JSF spec. They are collections of UI components. Facelets is not a taglib, and many tag libs can be used with Facelets.

like image 95
Malcolm Smith Avatar answered Sep 18 '22 15:09

Malcolm Smith