Monday, July 20, 2009

Taglibrary for JSF

JSF application typically uses JSP pages to represent views. JSF provides some useful special tags to enhance these views. JSF provides 43 tags in two standard JSF tag libraries:
  1. JSF Core Tags Library
  2. JSF Html Tags Library

Even a very simple page uses tags from both libraries.
<%@ taglib uri=”http://java.sun.com/jsf/core“ prefix=”f” %>

In the above code fragment we have imported two JSF tag libraries with the help of taglib directive. JSF Core Tag Library contains set of JSF core tags while JSF Html Tags Library contains set of html tags. Prefix is used to use tags defined in tag library. Here we are using conventional names f and h for Core & Html tags respectively. We have the choice to choose any name for the prefixes.

No comments:

Post a Comment