Java Reference
In-Depth Information
The generated JSP looks like this:
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%--
This file is an entry point for JavaServer Faces application.
--%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<f:view>
<h1>
<h:outputText value="JavaServer Faces"/>
</h1>
</f:view>
</body>
</html>
As we can see, a JSF enabled JSP file is a standard JSP file using a couple of
JSF-specific tag libraries. The first tag library, declared in our JSP by the
following line:
<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
is the core JSF tag library, this library includes a number of tags that are independent
of the rendering mechanism of the JSF application (recall that JSF can be used for
applications other than web applications). By convention, the prefix f (for faces) is
used for this tag library.
The second tag library in the generated JSP, declared by the following line:
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
 
Search WWH ::




Custom Search