JSF - (Tag|Component) library

> Procedural Languages > Java > JavaServer Faces (JSF)

1 - About

JavaServer Faces technology supports various tag libraries to add components to a web page.

Advertising

3 - Tag

To support the JavaServer Faces tag library mechanism, Facelets uses XML namespace declarations.

Tag Type Namespace Prefix Example Description
Templating http://java.sun.com/jsf/facelets ui: ui:component, ui:insert Templating
HTML http://java.sun.com/jsf/html h: h:head, h:body, h:outputText, h:inputText
JSF http://java.sun.com/jsf/facelets f: f:actionListener, f:attribute Tags for JavaServer Faces custom actions that are independent of any particular render kit
Core http://java.sun.com/jsf/core c: c:forEach, c:catch Used to perform core actions that are not performed by HTML tags
Functions Tags http://java.sun.com/jsp/jstl/functions fn: fn:toUpperCase, fn:toLowerCase JSTL 1.2 Functions Tags
Primeface http://primefaces.org/ui p p:themeSwitcher, p:datatable Component Library

In addition, Facelets supports tags for composite components, for which you can declare custom prefixes.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
        xmlns:h="http://java.sun.com/jsf/html"
        xmlns:f="http://java.sun.com/jsf/core"
        xmlns:ui="http://java.sun.com/jsf/facelets"
        xmlns:p="http://primefaces.org/ui">
..........