HTML and CSS Reference
In-Depth Information
<application>
<resource-bundle>
<base-name>com.jsfprohtml5.firstapplication.messages</base-name>
<var>bundle</var>
</resource-bundle>
</application>
</faces-config>
Listing 1-2 defines the application resource bundle globally in order to be used from the JSF expression language
( #{...} ) using the bundle variable (the JSF expression language will be illustrated in detail in Chapter 3).
Facelets Pages
The firstApplication contains two main pages: the first page ( index.xhtml ) represents the home page, and the other
page is the ( welcome.xhtml ) page, which represents the welcome page. Both pages refer to a template ( simple.xhtml )
page that is defined under the ( firstApplication/src/main/webapp/WEB-INF/templates/ ), as shown in Listing 1-3.
Listing 1-3. The simple.xhtml Template File
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html>
<html xmlns=" http://www.w3.org/1999/xhtml "
xmlns:ui=" http://java.sun.com/jsf/facelets "
xmlns:f=" http://java.sun.com/jsf/core "
xmlns:h= "http://java.sun.com/jsf/html">
<h:head>
<title><ui:insert name="title">#{bundle['application.defaultpage.title']}</ui:insert></title>
<link href="#{request.contextPath}/css/simple.css" rel="stylesheet" type="text/css"/>
</h:head>
<h:body>
<div id="container">
<div id="header">
<ui:insert name="header">
<h1>#{bundle['application.defaultpage.header.content']}</h1>
</ui:insert>
</div>
<div id="content">
<ui:insert name="content">
#{bundle['application.defaultpage.body.content']}
</ui:insert>
</div>
<div id="footer">
<ui:insert name="footer">
#{bundle['application.defaultpage.footer.content']}
</ui:insert>
</div>
</div>
</h:body>
</html>
 
Search WWH ::




Custom Search