HTML and CSS Reference
In-Depth Information
xmlns:ui=" "
xmlns:h=" "
xmlns:f=" " >
<ui:composition template="/WEB-INF/templates/simple.xhtml">
<ui:define name="title">
<ui:define name="content">
#{bundle['application.welcome']}, #{}! <br/>
<h:link value="#{bundle['application.welcomepage.return']}"
outcome="index"></h:link> <br/><br/>
The welcome.xhtml page includes the simple.xhtml template page using the <ui:composition> tag. Like the
index.xhtml page, in the welcome.xhtml page, the "title" and the "content" of the template are overridden with the
page title and the page content. The page content displays a welcome message that includes the name property of the
User managed bean using the #{} value expression. The page content includes a link to the introductory
page using the <h:link> tag. The <h:link> tag is a new tag that is introduced since JSF 2.0; it renders an HTML
anchor element. The value attribute of the <h:link> is rendered as the anchor text and its outcome attribute is used to
determine the target navigation page. In the welcome page, the outcome attribute value is set to "index" , which makes
an implicit navigation the "index.xhtml" page of the application.
Managed Beans
As illustrated in the Facelets pages section, there is a User managed bean that is binded with the input and output
components of the index and the welcome pages. Listing 1-8 shows the User managed bean.
Listing 1-8. The User Managed Bean
package com.jsfprohtml5.firstapplication.model;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
public class User implements Serializable {
private String name;
private String password;
public String getName() {
return name;
public void setName(String name) { = name;
Search WWH ::

Custom Search