Mastering JavaServer Faces 2.2

Master the art of implementing user interfaces with JSF 2.2

Mastering JavaServer Faces 2.2

Mastering
Anghel Leonard

Master the art of implementing user interfaces with JSF 2.2
$35.99
$59.99
RRP $35.99
RRP $59.99
eBook
Print + eBook
$12.99 p/month

Get Access

Get Unlimited Access to every Packt eBook and Video course

Enjoy full and instant access to over 3000 books and videos – you’ll find everything you need to stay ahead of the curve and make sure you can always get the job done.

Book Details

ISBN 139781782176466
Paperback578 pages

About This Book

  • Fortify your JSF solutions by combing the powers of JSF 2.x (2.0, 2.1, and 2.2)
  • Get acquainted with the newly introduced features in JSF 2.2, such as the faces flow, stateless views, pass-through attributes and resource library contracts
  • Browse through over 300 well defined JSF applications presented in a concise and clear cut approach

Who This Book Is For

If you are a web developer who uses JSF, this is the book for you. Catering to an intermediate-advanced audience, the book assumes you have fundamental knowledge of JSF. It is intended for the developer who wants to improve their skills with the combined power of JSF 2.0, 2.1, and 2.2.

Table of Contents

Chapter 1: Dynamic Access to JSF Application Data through Expression Language (EL 3.0)
EL syntax
EL immediate and deferred evaluation
EL value expressions
EL method expressions
The conditional text in JSF
Writing a custom EL resolver
EL 3.0 overview
Summary
Chapter 2: Communication in JSF
Passing and getting parameters
Managed bean communication
Summary
Chapter 3: JSF Scopes – Lifespan and Use in Managed Beans Communication
JSF scopes versus CDI scopes
The request scope
The session scope
The view scope
The application scope
The conversation scope
The flow scope
Dependent pseudo-scope
The none scope
The custom scope
Managed bean instantiation
Beans injection
Summary
Chapter 4: JSF Configurations Using XML Files and Annotations – Part 1
JSF 2.2 new namespaces
JSF 2.2 programmatic configuration
Configuring managed beans in XML
Working with multiple configuration files
Configuring locales and resource bundles
Configuring validators and converters
Configuring navigation
Configuring action listeners
Configuring system event listeners
Configuring phase listeners
Working with @ListenerFor and @ListenersFor
Summary
Chapter 5: JSF Configurations Using XML Files and Annotations – Part 2
Configuring resource handlers
Configuring the view handler
Overriding JSF renders
Working with client behavior functionality
JSF factories
Combined power of multiple factories
Summary
Chapter 6: Working with Tabular Data
Creating a simple JSF table
The CollectionDataModel class of JSF 2.2
Sorting tables
Deleting a table row
Editing/updating a table row
Adding a new row
Displaying row numbers
Selecting a single row
Selecting multiple rows
Nesting tables
Paginating tables
Generating tables with the JSF API
Filtering tables
Styling tables
Summary
Chapter 7: JSF and AJAX
A brief overview of the JSF-AJAX lifecycle
A simple JSF-AJAX example to get started
The JSF-AJAX attributes
Grouping components under <f:ajax> tag
Updating input fields with AJAX after validation error
Mixing AJAX and flow scope
Postback and AJAX
Is it a non-AJAX request?
AJAX and <f:param>
Queue control for AJAX requests
Explicit loading of jsf.js
AJAX and the progress bar/indicator
Summary
Chapter 8: JSF 2.2 – HTML5 and Upload
Working with HTML5 and JSF 2.2
JSF 2.2 upload feature
Summary
Chapter 9: JSF State Management
JSF saving the view state
JSF 2.2 is stateless
JSF security notes
Summary
Chapter 10: JSF Custom Components
Building noncomposite custom components
Building composite components
Summary
Chapter 11: JSF 2.2 Resource Library Contracts – Themes
Working with contracts
Styling tables with contracts
Styling UI components with contracts
Styling contracts across different devices
Writing contracts for composite components
Writing a theme switcher
Configuring contracts in XML
Packaging contracts in JARs
Summary
Chapter 12: Facelets Templating
A brief overview of the Facelets tags
Creating a simple template – PageLayout
Passing parameters via <ui:param>
Passing bean properties and action methods via <ui:param>
Exploiting the <ui:decorate> and <ui:fragment> tags
Iterating with <ui:repeat>
Working with <ui:include> and <f:viewParam>
Working with <ui:include> and <ui:param>
Debugging with <ui:debug>
Removing the content with <ui:remove>
Using the jsfc attribute
Extending the PageLayout template
Facelets' programmatic aspects
Facelets pitfalls
Summary

What You Will Learn

  • Discover how to write custom JSF 2.2 themes, custom factories, handlers, renderers, and components
  • Access unlimited developing scenarios with the concept of dependency injection
  • Enhance your applications with JSF 2.2 upload component and HTML5 friendly markup
  • Master the new JSF 2.2 Window ID technique
  • Gain insights into managing the application state with stateless viewsExplore the new CDI @ViewScoped and @FlowScoped (detailed presentation)

In Detail

JavaServer Faces (JSF) is a leading framework and core component of Java Platform Enterprise Edition. JSF is the standard Java EE technology used to build web user interfaces. JSF 2.2 is a recent release with an extensive list of new features, some of which have been expected for a long time and are now ready to be implemented.

Starting out with a very basic topic, Expression Language, you will continue onwards covering a wide range of JSF sectors, such as JSF communication, JSF scopes, and so on. Throughout the book, you will master JSF artifacts (AJAX, HTML5, configurations,  renders, handlers, listeners, events, factories, tabular data, custom components, Facelets, and so on) in a compendium of programming practices and informative examples.

You then round off with a detailed discussion on the capabilities of Facelets. Overall, this book helps you gain knowledge on the latest JSF features in an interesting and original approach. Adding these skills to your personal arsenal will turn you into a veritable JSF master.

Authors

Table of Contents

Chapter 1: Dynamic Access to JSF Application Data through Expression Language (EL 3.0)
EL syntax
EL immediate and deferred evaluation
EL value expressions
EL method expressions
The conditional text in JSF
Writing a custom EL resolver
EL 3.0 overview
Summary
Chapter 2: Communication in JSF
Passing and getting parameters
Managed bean communication
Summary
Chapter 3: JSF Scopes – Lifespan and Use in Managed Beans Communication
JSF scopes versus CDI scopes
The request scope
The session scope
The view scope
The application scope
The conversation scope
The flow scope
Dependent pseudo-scope
The none scope
The custom scope
Managed bean instantiation
Beans injection
Summary
Chapter 4: JSF Configurations Using XML Files and Annotations – Part 1
JSF 2.2 new namespaces
JSF 2.2 programmatic configuration
Configuring managed beans in XML
Working with multiple configuration files
Configuring locales and resource bundles
Configuring validators and converters
Configuring navigation
Configuring action listeners
Configuring system event listeners
Configuring phase listeners
Working with @ListenerFor and @ListenersFor
Summary
Chapter 5: JSF Configurations Using XML Files and Annotations – Part 2
Configuring resource handlers
Configuring the view handler
Overriding JSF renders
Working with client behavior functionality
JSF factories
Combined power of multiple factories
Summary
Chapter 6: Working with Tabular Data
Creating a simple JSF table
The CollectionDataModel class of JSF 2.2
Sorting tables
Deleting a table row
Editing/updating a table row
Adding a new row
Displaying row numbers
Selecting a single row
Selecting multiple rows
Nesting tables
Paginating tables
Generating tables with the JSF API
Filtering tables
Styling tables
Summary
Chapter 7: JSF and AJAX
A brief overview of the JSF-AJAX lifecycle
A simple JSF-AJAX example to get started
The JSF-AJAX attributes
Grouping components under <f:ajax> tag
Updating input fields with AJAX after validation error
Mixing AJAX and flow scope
Postback and AJAX
Is it a non-AJAX request?
AJAX and <f:param>
Queue control for AJAX requests
Explicit loading of jsf.js
AJAX and the progress bar/indicator
Summary
Chapter 8: JSF 2.2 – HTML5 and Upload
Working with HTML5 and JSF 2.2
JSF 2.2 upload feature
Summary
Chapter 9: JSF State Management
JSF saving the view state
JSF 2.2 is stateless
JSF security notes
Summary
Chapter 10: JSF Custom Components
Building noncomposite custom components
Building composite components
Summary
Chapter 11: JSF 2.2 Resource Library Contracts – Themes
Working with contracts
Styling tables with contracts
Styling UI components with contracts
Styling contracts across different devices
Writing contracts for composite components
Writing a theme switcher
Configuring contracts in XML
Packaging contracts in JARs
Summary
Chapter 12: Facelets Templating
A brief overview of the Facelets tags
Creating a simple template – PageLayout
Passing parameters via <ui:param>
Passing bean properties and action methods via <ui:param>
Exploiting the <ui:decorate> and <ui:fragment> tags
Iterating with <ui:repeat>
Working with <ui:include> and <f:viewParam>
Working with <ui:include> and <ui:param>
Debugging with <ui:debug>
Removing the content with <ui:remove>
Using the jsfc attribute
Extending the PageLayout template
Facelets' programmatic aspects
Facelets pitfalls
Summary

Book Details

ISBN 139781782176466
Paperback578 pages
Read More