In JSF and Facelets tags, what exactly are these prefixes?
- h:
- c:
- f:
- ui:
For example: h:head
c:catch
f:event
ui:decorate
etc.
In JSF and Facelets tags, what exactly are these prefixes?
For example: h:head
c:catch
f:event
ui:decorate
etc.
A prefix is used to qualify a tag as belonging to a specific tag library or in XML speak a namespace. The prefixes are declared in some way at the top of a JSF page (how depends on if you are using JSP or Facelets). An "h" usually corresponds to the HTML library but you could use any letter (or word) you wanted as the prefix. The common mappings are:
h http://java.sun.com/jsf/html
f http://java.sun.com/jsf/core
c http://java.sun.com/jsp/jstl/core
fn http://java.sun.com/jsp/jstl/functions
ui http://java.sun.com/jsf/facelets
<namespace>
element of a .taglib.xml
file which is placed in the /META-INF
folder of the tag library JAR file which is in turn placed in webapp's /WEB-INF/lib
. Note that the prefix can be changed freely to your choice. You can for example just declare xmlns:foo="http://java.sun.com/jsf/html"
and use <foo:outputText>
and so on. –
Poteet © 2022 - 2024 — McMap. All rights reserved.