Java Reference
In-Depth Information
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://xmlns.jcp.org/jsf/html">
<h:head>
<title>Facelet Title</title>
</h:head>
<h:body>
Hello from Facelets
</h:body>
</html>
As we can see, a facelet is nothing but an XHTML file using some JSF specific XML
namespaces. In the automatically generated preceding code the following namespace
definition allows us to use the h (for HTML) JSF component library:
xmlns:h="http://xmlns.jcp.org/jsf/html"
The preceding namespace declaration allows us to use JSF specific tags such
as <h:head> and <h:body> , which are a drop-in replacement for the standard
HTML/XHTML <head> and <body> tags, respectively.
Another very commonly used namespace in JSF is the f namespace, which is
typically defined as follows:
xmlns:f= "http://xmlns.jcp.org/jsf/core"
The f namespace contains tags that do not render directly in the page, rather it
allows us to specify the items in a drop-down list or, for instance, bind actions
to our JSF components.
The application generated by the new project wizard is a simple but complete JSF
web application. We can see it in action by right-clicking on our project in the project
window and selecting Run . Now, the application server starts (if it wasn't already
running). Then, the application is deployed and the default system browser opens
to display our application's default page.
 
Search WWH ::




Custom Search