Facelets

Uses your system voice; voice and rate in settings.

Q917721Snapshot

≈ 5 min read

Names in other languages

  • ČeštinaFacelets
  • DeutschFacelets
  • EnglishFacelets
  • FrançaisFacelets
  • NederlandsFacelets
  • РусскийFacelets
  • УкраїнськаFacelets
  • MagyarFacelet

Article bodies are English and are not machine-translated. A name in another language is not a translation of the article.

In computing, Facelets is an open-source Web template system under the Apache license and the default view handler technology (aka view declaration language) for Jakarta Faces (JSF; formerly Jakarta Server Faces and JavaServer Faces). The language requires valid input XML documents to work. Facelets supports all of the JSF UI components and focuses completely on building the JSF component tree, reflecting the view for a JSF application. Although both JSP and Faces technologies have been improved to work better together, Facelets eliminates the issues noted in Hans Bergsten's article "Improving JSF by Dumping JSP" Facelets draws on some of the ideas from Apache Tapestry, and is similar enough to draw comparison. The project is conceptually similar to Tapestry's, which treats blocks of HTML elements as framework components backed by Java classes. Facelets also has some similarities to the Apache Tiles framework with respect to support templating as well as composition. Facelets was originally created by Jacob Hookom in 2005 as a separate, alternative view declaration language for JSF 1.1 and JSF 1.2 which both used JSP as the default view declaration language. Starting from JSF 2.0, Facelets has been promoted by the JSF expert group to be the default view declaration language. JSP has been deprecated as a legacy fall back.

In computing, Facelets is an open-source Web template system under the Apache license and the default view handler technology (aka view declaration language) for Jakarta Faces (JSF; formerly Jakarta Server Faces and JavaServer Faces). The language requires valid input XML documents to work. Facelets supports all of the JSF UI components and focuses completely on building the JSF component tree, reflecting the view for a JSF application. Although both JSP and Faces technologies have been improved to work better together, Facelets eliminates the issues noted in Hans Bergsten's article "Improving JSF by Dumping JSP" Facelets draws on some of the ideas from Apache Tapestry, and is similar enough to draw comparison. The project is conceptually similar to Tapestry's, which treats blocks of HTML elements as framework components backed by Java classes. Facelets also has some similarities to the Apache Tiles framework with respect to support templating as well as composition. Facelets was originally created by Jacob Hookom in 2005 as a separate, alternative view declaration language for JSF 1.1 and JSF 1.2 which both used JSP as the default view declaration language. Starting from JSF 2.0, Facelets has been promoted by the JSF expert group to be the default view declaration language. JSP has been deprecated as a legacy fall back. ==Element conversion== In Facelets, templates tags from a tag library can be entered in two forms: directly as a qualified xml element or indirectly via the jsfc attribute on an arbitrary non-qualified element. In the latter case the Facelet compiler will ignore the actual element and will process the element as if it was the one given by the jsfc attribute. The following example shows the direct usage of qualified tags: Using the jsfc attribute, the same code can also be expressed as the example given below: The above code can be viewed in a browser, and edited with conventional WYSIWYG design tools. This is not possible when directly using the qualified tags. Nevertheless, directly using qualified tags is the most popular way of using Facelets in practice and is the style most used in books and examples. Standard header text for every page. Standard footer text for every page. The above code contains a default HTML 'frame' and a single placeholder called body_content. A template client can use this template as follows: template_client.xhtml This is a template client page that uses the master template. The above code makes use of the template /templates/master_template.xhtml and provides content for the placeholder in that template. The final result will be a page called template_client.xhtml that has the content of /templates/master_template.xhtml , but with replaced by 'This is a template client page that uses the master template.'. Standard header text for every page. Standard footer text for every page. html_head.xhtml Standard header text for every page. Standard footer text for every page. The code above uses the tag to mark the point in the Facelet where content is to be inserted. Such a tag has to be declared in a Taglib file where it can be associated with a Facelet as follows: example.taglib.xml http://example.com/my spacer spacer.xhtml The following shows an example of what the actual content Facelet could look like: spacer.xhtml The above Facelet is automatically available as a component in namespace 'http://java.sun.com/jsf/composite/my' and tag name 'spacer' ==References== ==Bibliography== ==External links== "Introduction to Facelets" Chapter 8 of The Jakarta EE Tutorial

Text derived from https://en.wikipedia.org/w/index.php?oldid=1286641252 under CC BY-SA 4.0; modifications have been made.

Provenance

snapshot facelets-105840-67e6f885da1aca91 · hash 67e6f885da1aca910418396e7aca3ed98fc65f95af71e7b082edfde1c89964c4 · captured 1745199731.0 · version history

Cite this page as: encyclopegia.org, “Facelets”, snapshot facelets-105840-67e6f885da1aca91. https://encyclopegia.org/a/facelets