After the user has filled in information in index.xhtml and clicks on the "Login" button the welcome.xhtml page is displayed. This page has HTML and JSF tags similar to index.xhtml. It declares namespaces just like index.xhtml. However, it has no navigation.
welcome.xhtml does access the user bean. Here it is getting the bean value rather than setting it.
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html"> <h:head> <title>Welcome</title> </h:head> <h:body> <h3>Welcome to JavaServer Faces, #{user.name}!</h3> </h:body> </html>
The connection to the user bean is made in the following line. When this page is about to be shown the getName() method of the user bean is invoked on the server.
<h3>Welcome to JavaServer Faces, #{user.name}!</h3>