Guide The Definitive Guide to Apache MyFaces and Facelets

Free download. Book file PDF easily for everyone and every device. You can download and read online The Definitive Guide to Apache MyFaces and Facelets file PDF Book only if you are registered here. And also you can download or read online all Book PDF file that related with The Definitive Guide to Apache MyFaces and Facelets book. Happy reading The Definitive Guide to Apache MyFaces and Facelets Bookeveryone. Download file Free Book PDF The Definitive Guide to Apache MyFaces and Facelets at Complete PDF Library. This Book have some digital formats such us :paperbook, ebook, kindle, epub, fb2 and another formats. Here is The CompletePDF Book Library. It's free to register here to get Book file PDF The Definitive Guide to Apache MyFaces and Facelets Pocket Guide.
Excerpt from The Definitive Guide to Apache MyFaces and Facelets by Zubin Wadia, Martin Marinschek, Hazem Saleh, Dennis Byrne. Published by Apress.
Table of contents

Without their vision, this comprehensive book would not have an audience. Additionally, we would like to acknowledge the contributions of Simon Kitching, who is a regular committer to MyFaces and the Orchestra projects. His insight and attention to detail have been valuable to the continuing growth and applicability of Orchestra. Arash Rajaeeyan also provided valuable input, contributions, and insight into Tomahawk and the IDE setup. We are grateful for their inputs. Finally, we would like to thank the MyFaces and JSF community as a whole for their tireless support and contributions to a variety of subprojects.

Without this anarchic collaboration, MyFaces would cease to be competitively differentiated against the Sun Reference Implementation. It also is the most responsive to user issues and has a vibrant community that ensures progression you can always find free support on the mailing lists. This anarchic collaboration, a term coined by Roy Fielding, is the essence of the Apache MyFaces project: many talented people share information with a single-minded objective to make JSF a pleasurable developer experience for all. Before the Sun JSF 1. Even today, many developers are happy with simply using MyFaces 1.

This book assumes you are interested in JSF and component-oriented development. It takes you through a journey beginning with the unique aspects of JSF, introduces you to the MyFaces specification, and continues with building your first application. Once you ve mastered that, this book advances your skill set further by taking you into the world of the Tomahawk component library. Next, we take you into one of the most important chapters in the book learning to leverage Facelets s powerful view-definition capabilities within your JSF application.

After absorbing the material in this chapter, you will be able to write JSF view tiers with greater efficiency and yield more performance out of your applications, as compared to similar applications leveraging classic JSP. The patterns we encourage in this chapter are a result of our more than ten years of cumulative experience with JSF across two of the major Reference Implementations: Sun and MyFaces.

The second half of this book focuses on smaller but equally critical projects to the future of MyFaces: Trinidad, Tobago, and Orchestra. Trinidad and Tobago offer highquality component libraries that are particularly adept at custom rendition, themes, and layouts. Trinidad s presence is also a testament to the commercial support of MyFaces xix. Although a relatively young project, Orchestra offers powerful functionality like conversation scope for persistencerich JSF applications.

The final chapter weaves together all your newfound knowledge and shows how to avoid some of the common antipatterns new JSF developers often end up pursuing.

Your Answer

JSF is a complex specification augmented by a significant number of support frameworks to assist with development. We make sure the details in this book allow you to make educated decisions on which ones to leverage. Finally, be sure to take advantage of the book s modular nature.

We tried to strike a natural balance between this book being a guide and a reference. Refreshing your memory on a particular topic is extremely easy because of the atomic nature of each chapter. In this chapter, we will explain the core architecture of JavaServer Faces JSF and how the technology has evolved over the last few years.

This chapter will make you aware of the ingredients of any JSF application and of the critical features added in JSF s major releases 1.

The chapter will introduce the Apache MyFaces platform and some of the key differentiating features and competitive advantages it presents over the standard Sun Reference Implementation RI. The Evolution of Java Web Frameworks Java web application development today is within a unique period in its history.

Cagatay Civici

Hundreds of frameworks, a dynamic open source community, rapidly evolving web development standards, and a thirst for dynamic interfaces make the developer s job simpler and more difficult simultaneously. Choices made six months ago that seemed graced with genius now feel outdated, as new approaches and versions have already superceded them. A seemingly difficult problem that might have taken weeks to crack has been permanently resolved by a colleague halfway around the world. Developing for the web is demanding.

It requires an astute understanding of the history behind HTML, JavaScript, and other web development tools and some of the overarching trends that figure as central themes. Modern Java web applications tend to have the following characteristics: Complex functionality as core business processes become web enabled Increased interactivity with the user for validation, verification, and notification A simple and consistent user interface Adherence to web standards such as CSS and XHTML Java web development began with the Servlet specification in and was progressively enhanced and refactored for ease of use with the advent of JavaServer Pages JSP in , the Struts Action Framework in , and finally JavaServer Faces in see Figure The evolution of Java web frameworks Servlets The Servlet specification is significant, because it is still at the core of all Java web development specifications.

Understanding its internal working offers insight into the low-level pipelining occurring within your abstracted web application. Listing shows a simple servlet. Listing The Hello World Servlet Example import java. The HttpServletRequest parameter allows you to get the incoming request data, while the HttpServletResponse parameter allows outputting the response to the client.

Classical servlet programming mixes HTML with Java code, which leads to complex development and maintainability concerns for both web designers and developers.

NDL India: The Definitive Guide to Apache MyFaces and Facelets

The Java code can be separated from the markup in three ways: Encapsulating Java code with standard HTML tags around it Using beans Using JSP tags that employ Java code behind the scenes JSP made the web application code base easier to maintain and gave developers more freedom in terms of the way they organized the content of their pages though encapsulating Java code in the page is now frowned upon because it doesn t really separate the Java code from the markup.

It s still not an ideal situation, however. In a typical MVC implementation, often called Model 2, the servlet acts as a controller for incoming requests from the client, routing requests to a JavaBean model to fetch data and then handing it over to the related JSP view to render the appropriate markup, update the model, and issue a response to the client. Figure shows these MVC architectural pattern steps, which together form the Model 2 architecture.

Figure Model 2 architectural pattern Struts 1. The problem with having so many frameworks is that each one ends up implementing unique and widely desired features within their stacks. Developers then tried to make two or more frameworks work together or extend each other to meet their design objectives. This approach resulted in a magnification of the inherent complexity of a web project and ended up being a futile quest. In other words, there was no unified standard for Java web development and no standardized API existed for building web components. These difficulties gave birth to JavaServer Faces JSF , a standard developed by Sun Microsystems under the Java Community Process to provide a powerful component-based, eventdriven platform for web application development in Java.

Along with this significant advance came equally significant shortcomings that would limit developer adoption.

The Sun Expert Group worked hard on the specification and, in , released version 1. After the release of version 1. Some major enterprise applications use Apache MyFaces within their web tiers today, proving the real-world viability of JSF 1. These goals were related to creation of a standard GUI component framework that can be supported by development tools that allowed JSF developers to create custom components by extending base framework components, defining APIs for input validation and conversion, and specifying a model for GUI localization and internationalization.

You can read the complete JSR at detail? In May , JSF 1.

Account Options

JSF 1. Lastly, JSF 1. JSF 2. JSF Features JSF, in a nutshell, is a standardized, component-based, event-driven framework for Java web applications with a strong focus on rapid development and best practices. It allows web designers or UI engineers to create simple templates for a given application. It allows Java developers to write the backend code independently of the web tier.

And lastly, it allows third-party vendors to develop tools and component libraries that are compliant with the specification. Each event triggers a method call with action and event handlers. The state of a web application changes due to a given event. JSF offers developers A set of standard converters and validators likely to be used in a web application A set of standard components likely to be used in a web application. The model can also be called the business tier binding. The view handles the rendering via render kits.

JSF has a very different request processing life cycle with six phases: 1. Restore view. Apply request values; process events. Process validations; process events. Update model values; process events. Invoke application; process events.