Skip to Content
Facelets
book

Facelets

by Robert Swarr
March 2007
Beginner to intermediate content levelBeginner to intermediate
101 pages
2h 41m
English
O'Reilly Media, Inc.
Content preview from Facelets

Chapter 7. Extending and Customizing Facelets

7.1 Extensibility: JSF and Facelets

Extensibility is one of JSF's greatest strengths. JSF achieves its extensibility by using default implementations of pluggable classes to deliver its core functionality. These classes include implementations of ActionListener, NavigationHandler, VariableResolver, PropertyResolver, ViewHandler, and StateManager. They are surprisingly simple to extend because JSF allows you to decorate the default implementation. If the custom pluggable class contains a constructor that takes an argument of the class that it extends, JSF uses that constructor and passes in the previously registered implementation. You can decorate the behavior of the default implementation with custom logic and delegate to the default implementation. Additionally, all components delegate generating client output to a Renderer class, which also is easily replaced by a custom implementation. If none of the existing components meet your application needs, you can either extend an existing one or develop a custom component. In short, just about everything in JSF can be extended or replaced with a modest effort.

Facelets itself is an example of the extensibility of JSF. As previously mentioned in Chapter 1. Introducing Facelets: A Better JSF ViewHandler, it is integrated into JSF as a custom ViewHandler. Quite naturally, Facelets is true to its roots—like JSF, it also is easily extended. Chapter 6. Developing and Using Composition Components ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Java™ Performance

Java™ Performance

Charlie Hunt, Binu John
JavaServer Faces

JavaServer Faces

Hans Bergsten
Core JavaServer™ Faces

Core JavaServer™ Faces

David Geary, Cay S. Horstmann

Publisher Resources

ISBN: 9780596529246Publisher SupportErrata PageSupplemental Content