A Book Viewer and a Library

Chapter 8. Subviews and Tiles

Topics in This Chapter

  • "Common Layouts" on page 315

  • "A Book Viewer and a Library" on page 316

  • "The Book Viewer" on page 318

  • "Content Inclusion in the Book Viewer" on page 328

  • "The Library" on page 339

User interfaces are typically the most volatile aspect of web applications during development, so it is crucial to create flexible and extensible interfaces. This chapter shows you how to achieve that flexibility and extensibility by including common content. First we discuss standard JSP mechanisms JSP includes and JSTL imports that you can use to include common content in a JSF application. Next, we explore the use of the Apache Tiles package which lets you encapsulate layout in addition to content, among other handy features with JSF.

Common Layouts

Many popular web sites, such as nytimes.com, java.sun.com, or amazon.com, use a common layout for their web pages. For example, all three of the web sites listed above use a header-menu-content layout, as depicted in Figure 8-1.

Figure 8-1. A typical web page layout


You can use HTML frames to achieve the layout shown in Figure 8-1, but frames are undesirable for several reasons. For example, frames make it hard for users to bookmark pages. Frames also generate separate requests, which can be problematic for web applications. Including content, which is the focus of this chapter, is generally preferred over frames



Core JavaServerT Faces
Core JavaServer(TM) Faces (2nd Edition)
ISBN: 0131738860
EAN: 2147483647
Year: 2004
Pages: 84

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net