Java Enterprise in a Nutshell (In a Nutshell (OReilly))
The JavaServer Faces API provides a standard framework for building presentation tiers for web applications. Unlike the Servlet API, which focuses on low-level request handling for the HTTP protocol, JSF provides developers with a set of prewritten user interface (UI) components and an event model for wiring interactions between the UI and the objects underlying your application. The JSF team's goal was to streamline and standardize web UI development. JSF was also designed to be tool-friendly, allowing IDE vendors to support drag-and-drop user interface generation while retaining standardized, portable code and allowing third parties to develop UI components that any JSF developer can use. JSF is included in the J2EE 1.4 framework, but since it requires only the Servlet 2.3 and JSP 1.1 APIs, JSF applications can be deployed in a J2EE 1.3 environment as well. This chapter provides a whirlwind introduction to programming with JavaServer Faces. Since JSF IDEs aren't yet very mature, and this is a Nutshell book anyway, we focus on the underlying code: if you start using a tool later, you'll have an understanding of how the API itself works, and, of course, you can always write a JSF UI by hand. While JSF might seem more conceptually daunting than other web frameworks, such as Struts, it's actually quite easy to work with by hand once you've gained some basic familiarity with the API. JSF uses JSP tags to create user interfaces, so if you've never written a JSP page, you might want to take a quick look through Chapter 4 and then come back. Appendix B provides a reference for all the standard JSP tags provided by the basic JSF implementation since we can't cover them all in any detail in a short tutorial. We've also elected not to discuss some advanced features, such as rendering for non-HTML output and developing custom components. For a much more extensive tutorial, please see JavaServer Faces by Hans Bergsten (O'Reilly). |