Java Reference
In-Depth Information
Listing 6-22. sideBar.xhtml
1. <?xml version="1.0" encoding="UTF-8"?>
2. <!DOCTYPE html >
3. <html xmlns="
http://www.w3.org/1999/xhtml
"
4. xmlns:h="
http://java.sun.com/jsf/html
"
5. xmlns:ui="
http://java.sun.com/jsf/facelets
">
6. <h:form>
7. <div class="leftbar">
8. <ul id="menu">
9. <li><div>
10. <a class="link1" href=""><span class="label"
11. style="margin-left: 15px;">Home</span>
12. </a>
13. </div></li>
14. <li><div>
15. <h:commandLink class="link1" action="#{bookController.listAllBooks}">
16. <span style="margin-left: 15px;" class="label">All Books</span>
17. </h:commandLink>
18. </div></li>
19. <li><div>
20. <span class="label" style="margin-left: 15px;">Categories</span>
21. </div>
22. <ul>
23. <li><a class="label" href=""><span class="label"
24. style="margin-left: 30px;"></span></a></li>
25. </ul></li>
26. <li><div>
27. <span class="label" style="margin-left: 15px;">Contact Us</span>
28. </div></li>
29. </ul>
30. </div>
31. </h:form>
32.
33. </html>
Line 6
: Shows the usage of the
h:form
tag instead of using the markup
<form>
Line 15
: Shows the usage of the
h:commandlink
tag that triggers the
listAllBooks
action on the
bookController
managed bean using the deferred EL
Developing the User Interface Using UI Components and JSF EL
Now you will develop the UI of the application. Figure
6-19
illustrates the home page of the
application. When the user clicks All Books in the sidebar, the list of all books is displayed,
as illustrated in Figure
6-20
.