Reputation: 1065
Am farely new to JSF and I get easily confused between JSF and Facelets when I read tutorials...
What are Facelets ?..Is JSF & Facelets the same ?...
How is Facelets different from JSTL ?
Upvotes: 2
Views: 1481
Reputation: 629
Facelets is a powerful but lightweight page declaration language that is used to build JavaServer Faces views using HTML style templates and to build component trees. Facelets features include the following:
·Use of XHTML for creating web pages
·Support for Facelets tag libraries in addition to JavaServer Faces and JSTL tag libraries
·Support for the Expression Language (EL)
·Templating for components and pages
Basically, Facelets allows you to add template tag libraries (XML documents) that are useful for adding UI controls in html pages, if you work with JSF. this declaration is an example of Facelets:
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html">
<!-- look at the xml library 'import' -->
<body>
<h:form>
<h:outputText value="Welcome, #{loggedInUser.name}" disabled="#{empty loggedInUser}" />
<h:inputText value="#{bean.property}" />
<!-- look at this tags, the special mark 'h:outputText'... -->
<h:commandButton value="OK" action="#{bean.doSomething}" />
</h:form>
</body>
</html>
In conclusion, Facelets provides the tools (template tag libraries) for UI controls and JSF allows the communication of this controls with back-beans.
http://en.wikipedia.org/wiki/Facelets
http://docs.oracle.com/javaee/6/tutorial/doc/gijtu.html
Upvotes: 5