The Full Wiki

Facelets: Wikis


Note: Many of our articles have direct quotes from sources you can cite, within the Wikipedia article! This article doesn't yet, but we're working on it! See more info or our list of citable articles.


From Wikipedia, the free encyclopedia

Stable release 1.1.15 / 2009-11-24; 52 days ago
Preview release 1.2-dev / 2009-11-10; 2 months ago
Written in Java
Operating system Cross-platform
Size 5.07 MB (archived)
Type Web Framework
License Apache License 2.0

Facelets is an open source web framework under the Apache license and alternative view handler technology for the JavaServer Faces (JSF). The framework requires a valid input XML documents to work. This means that all web pages must be valid XHTML format. Facelets supports all of the JSF UI components and builds its own component tree, reflecting the view for a JSF application. Although both JSP and JSF technologies have been improved to work better together, Facelets eliminates the issues noted in Hans Bergsten's article "Improving JSF by Dumping JSP"[1]

Facelets is similar enough to Apache Tapestry to draw comparison. In fact, Tapestry was well ahead of its time when it first came out, and Facelets does draw on some of its ideas. The project conceptually similar to Tapestry's which use jwcid attribute and Facelets uses jsfc and proper namespaces to convert HTML elements to their associated JSF component. Also, there are some similarity to Tiles framework and support templating as well as composition.

As the next development of JavaServer Faces 2.0, the specification is widely influenced by Facelets and expected to be part of the standard JSR 314.



The following example shows an XHTML template for taking the use of Facelets component-aliasing. The jsfc attribute is used here, shows which tags to replace when compiling the page with the corresponding JavaServer Faces components.

Transitional//EN" "">
<html xmlns="" xmlns:h="">
  <form jsfc="h:form">
   <span jsfc="h:outputText" value="Willkommen #{}" 
   disabled="#{empty loggedInUser}" />
   <input type="text" jsfc="h:inputText" value="#{}" />
   <input type="submit" jsfc="h:commandButton" value="OK" action="#{bean.doSomething}" /> 

The above code can be viewed in a browser, and edited with conventional WYSIWYG design tools. This is not possible with regular JSF 1.2 pages (shown below the same functionality).

Transitional//EN" "">
<html xmlns="" xmlns:h="">
   <h:outputText value="Willkommen #{}" disabled="#{empty loggedInUser}" />
   <h:inputText value="#{}" />
   <h:commandButton value="OK" action="#{bean.doSomething}" /> 



See also

External links



Got something to say? Make a comment.
Your name
Your email address