Skip to main content
Top

2013 | Book

Pro JSF and HTML5

Building Rich Internet Components

Authors: Hazem Saleh, Allan Lykke Christensen, Zubin Wadia

Publisher: Apress

insite
SEARCH

About this book

Pro JSF and HTML5 shows you how to leverage the full potential of JavaServer Faces (JSF) and HTML5. This book is for Java developers who aspire to build sophisticated, enterprise-grade web experiences with HTML5-enabled JSF. Written by JSF experts and verified by established community figures, this book will serve as your primary resource, helping you build or integrate well-designed HTML5-enabled JSF components into your rich internet applications.

Pro JSF and HTML5 starts by giving you a firm grounding in the design principles of component-based frameworks and the basics of JSF. It then details recent advancements in JSF 2.2 that make it friendlier, faster, and more productive than ever before. And it covers HTML5-enabled components, integration with JEE7 standards, 3rd party component libraries, security, and performance. The book concludes with a real-world application that puts everything you learned into practice.

In this book you’ll learn

Foundational JSF topics such as the component life cycle, framework architecture, managed beans and CDI, expression language, conversion and validation, JSF events and view parameters.

Leveraging new features in JSF 2.2 such as Faces Flow, Resource Library Contracts, and Ajax file uploading.

Developing Advanced HTML5 enabled components in JSF 2.2.

Creating JSF 2.2 applications that utilize Java EE 7 technologies (CDI, JPA 2.1 and EJB 3.2) for bean management, transaction management and persistence.

Building advanced real-world JSF applications with considerations for security, performance, and usability.

If you’re a Java developer interested in the world of component-based frameworks, Pro JSF and HTML5 is for you.

Table of Contents

Frontmatter
Chapter 1. JSF Introduction
Abstract
This chapter will explain what the JavaServer Faces (JSF) framework is, how the framework evolved over time, key aspects of its architecture, and details about its signature request processing life cycle. Beyond explanations, we’ll go hands-on and guide you through your first JSF application from scratch using JSF 2.1 and Maven 3; you will learn how to deploy your JSF 2.1 application on two different web containers (GlassFish and Tomcat). If you are already familiar with JSF at a basic component level, a deeper understanding of the request life cycle will serve you well when tasked with more complex applications.
Hazem Saleh, Allan Lykke Christensen, Zubin Wadia
Chapter 2. JSF Under the Hood—Part 1
Abstract
This chapter illustrates important topics in the JSF framework. In this chapter, you will learn in detail about the JSF managed beans and the expression language (EL). You will also learn a bit about JSF navigation. Finally, you will learn how to utilize the JSF exception handling mechanism in your JSF web applications for empowering the applications error handling.
Hazem Saleh, Allan Lykke Christensen, Zubin Wadia
Chapter 3. JSF Under the Hood—Part 2
Abstract
JSF conversion and validation is one of the most important topics in the JSF framework which is covered in detail in this chapter. This chapter explains how conversion and validation works in the JSF request processing life cycle. You will learn how to use and customize the standard JSF converters and validators in your JSF application(s) and how to create your own custom converters and validators when the standard converters and validators do not fully fit the application’s needs. Finally, you will understand how to utilize Java Bean Validation (JSR 303) APIs in order to empower and standardize your JSF application validation.
Hazem Saleh, Allan Lykke Christensen, Zubin Wadia
Chapter 4. JSF Under the Hood—Part 3
Abstract
In this chapter, you will learn in detail how to empower your JSF applications by understanding the JSF event model. After you finish this chapter, you will understand the different JSF event types (JSF Faces events, Phase events, and System events). You will learn how to work with JSF events in your JSF applications. And in the last section, you will learn how to utilize the JSF view parameters in order to produce RESTful JSF pages that can be bookmarked by the end users and can be indexed by web search crawlers.
Hazem Saleh, Allan Lykke Christensen, Zubin Wadia
Chapter 5. JSF 2.2: What’s New?
Abstract
The work on JSF 2.2 started in early 2011, just a couple of months after the second maintenance release of JSF 2.0. After two years of work on the specification and reference implementation (Mojarra 2.2), JSF 2.2 was released in late May 2013. JSF 2.2 is also part of Java EE 7 released in June 2013. JSF 2.2 provides a handful of exciting new features (also known as the big-ticket features), a number of significant improvements, and quite a few specification clarifications and bug fixes. JSF 2.2 is backwards compatible with earlier 2.0 releases. This is great news, as you won’t have to rewrite your JSF 2.0 application to support the new features of 2.2. There are a couple of exceptions where you would have to make minor changes to your application.
Hazem Saleh, Allan Lykke Christensen, Zubin Wadia
Chapter 6. Going Deep: JSF Custom Components
Abstract
Up till now we have looked at Java Server Faces from the page author’s and application developer’s point of view. Page authors are concerned with authoring the user interface, which is about building the markup, scripts, and styles in Facelet views where JSF components are utilized to introduce dynamic content and behavior. Application developers are concerned with writing the server-side behavior of an application. That includes building managed JSF beans used directly by the page author’s Facelet views as well as Enterprise Java Beans (EJBs) containing business logic and mechanisms for persistence such as JPA entities.
Hazem Saleh, Allan Lykke Christensen, Zubin Wadia
Chapter 7. Basic JSF2 HTML5 Components
Abstract
HTML5 introduced new web form elements to cater to common input types. None of these new elements have JSF equivalents. In this chapter we will look at four of the new HTML5 input types and implement them as composite components. The input types implemented in this chapter are the Input Color, Date Picker, Slider, and Spinner types. The other components are left as an exercise for the reader to implement. A complete list of the new input types can be found in Table 7-1.
Hazem Saleh, Allan Lykke Christensen, Zubin Wadia
Chapter 8. Advanced JSF2 HTML5 Components
Abstract
In the previous chapter we built JSF2 components for some of the new input elements introduced in HTML5. In this chapter we will continue building JSF2 components that take advantage of some of the new non-input HTML5 elements.
Hazem Saleh, Allan Lykke Christensen, Zubin Wadia
Chapter 9. JSF Component Libraries
Abstract
In this chapter, you will learn briefly how to utilize JSF component libraries in order to produce nifty-looking web applications. You will be introduced to two of the most famous JSF open-source component libraries, which are PrimeFaces and RichFaces. Although going into the details of these frameworks is outside the scope of this book because these frameworks are really big and cannot be covered in one single chapter, we will give you an overview of the different components shipped with each of the component libraries and how to use these libraries in order to create nifty-looking JSF 2.2 web applications.
Hazem Saleh, Allan Lykke Christensen, Zubin Wadia
Chapter 10. Creating a Basic JSF 2.2 Application
Abstract
In this chapter, you will learn in detail how to create a Basic JSF 2.2 application in Java EE 7 environment. This application will show you how to design and develop your JSF application in Java EE 7 environment. The application utilizes JSF 2.2 for creating the pages and handling the pages flow, CDI (Contexts and Dependency Injection) for bean management, EJB 3.2 for transaction handling, and JPA 2.1 for data persistence.
Hazem Saleh, Allan Lykke Christensen, Zubin Wadia
Chapter 11. JSF2 Advanced Topics
Abstract
This chapter is a collection of advanced topics that JSF application writers must take into consideration when writing real-life JSF applications. We will also look at how to use the <f:ajax> tag to Ajaxify and improve the user experience. The Ajax section is followed up with examples of using JavaScript to tap into the JSF JavaScript API. Finally you cannot build a real-world application without thorough testing. We will examine the Arquillian testing framework sponsored by Red Hat through the JBoss Community.
Hazem Saleh, Allan Lykke Christensen, Zubin Wadia
Chapter 12. JSF2 Security and Performance
Abstract
In this chapter, you will learn how to secure your JSF application using the security features provided by Java EE containers. You know how to apply container-managed authentication, authorization, and data protection in the weather application that was introduced in Chapter 10. In this chapter, you will also learn how to tune the performance of your JSF application in order to make your JSF pages more responsive.
Hazem Saleh, Allan Lykke Christensen, Zubin Wadia
Chapter 13. Applying It All: The Mega App
Abstract
In this chapter, we will apply most of what we learned in the previous chapters in a sample application which we will call the Mega App. We will start from the application specification and wireframes and after understanding the application requirements, we will develop the application architecture including Data model, back-end services, front-end templates, application security including authentication, and authorization and error handling. And we will see how to implement this architecture using Java EE 7 technologies. The Mega App application utilizes many Java EE 7 technologies: it uses JSF 2.2 for handling the user interface interactions with the help of Twitter Bootstrap, EJB 3.2 for transaction handling, JPA 2.1 for persistence, CDI 1.1 for bean management, and Java Bean Validation for handling model validation. In this chapter, you will learn how to create a suitable application architecture and implementation for JSF 2.2 applications in the Java EE 7 space.
Hazem Saleh, Allan Lykke Christensen, Zubin Wadia
Backmatter
Metadata
Title
Pro JSF and HTML5
Authors
Hazem Saleh
Allan Lykke Christensen
Zubin Wadia
Copyright Year
2013
Publisher
Apress
Electronic ISBN
978-1-4302-5011-1
Print ISBN
978-1-4302-5010-4
DOI
https://doi.org/10.1007/978-1-4302-5011-1

Premium Partner