What exactly do h: c: f: and ui: denote in JSF tag library?
Asked Answered
B

1

8

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.

Buckley answered 24/7, 2012 at 23:13 Comment(2)
Your two questions are mostly unrelated. You'd get better answers by asking each one in a separate post.Snuggle
ohh thanks... lemme post them separatelyBuckley
U
10

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
Unpleasant answered 24/7, 2012 at 23:34 Comment(2)
ohh thanks, so these prefixes maps with above particular links. but these linkes are not working - opening them says "Sorry! We couldn't find your document."Buckley
The taglib URI doesn't necessarily need to be a real web address. It's merely an unique namespace idenfifier which is declared in the <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.