Welcome!

Java IoT Authors: Pat Romanski, Yeshim Deniz, Zakia Bouachraoui, Liz McMillan, Elizabeth White

Related Topics: Java IoT, Machine Learning

Java IoT: Blog Feed Post

Book Review: JSF 2.0 Cookbook

The book is good and loaded with useful recipes and code examples

Last July, I was asked to review JSF 2.0 Cookbook by Anghel Leonard. I finally found time to finish reading the book and wrote a review. (If you are interested, back in April I reviewed another book from Packt Publishing: JSF 1.2 Components.)

Chapter 1 – Using Standard and Custom Converters in JSF
The chapter covers how to use standard converters and how to build custom converters. The author does a good job covering the standard out-of-the-box converters with a number of examples. The chapter then shows how to create your own custom converter. There are a number of small typos, but that’s not a big deal. Although standard and custom converters are covered in regular JSF books, it’s a topic that many people have difficulties with so I think there is a place for them in a recipe-type book. Two other things I found useful are discussions of RichFaces build-in converters and MyFaces converters.

Chapter 2 – Using Standard and Custom Validators in JSF
Similar to chapter 1, chapter 2 covers how to use standard validators and how to build custom validators. There are good examples such as how to overwrite default validation error messages. The chapter also covers RichFaces’ rich:beanValidator and rich:ajaxValidator, which work with Hibernate Validator. MyFaces Commons validators are covered as well. The chapter ends with coverage of new validation features in JSF 2 such as f:validateBean, f:validateRequired, and f:validateRegex.

Chapter 3 – File Management
This chapter covers file management – more specifically, file upload and download. It’s a good chapter with good examples and tips. (How- to on use file uploading is usually a frequently asked question on various JSF forums.)

Chapter 4 – Security
The chapter covers securing JSF applications. The chapter covers four different recipes or examples for securing a JSF application. Each of the four recipes uses a different framework/approach: working with the JSF Security project, using the JSF Security project without JAAS Roles, using secured managed beans with JSF Security, and Using Acegi/Spring security in JSF applications. It’s a good chapter. JSF developers often ask how to secure a JSF application and I believe this chapter provides good coverage of this topic.

Chapter 5 – Custom Components
The chapters starts with showing how to build a simple “Hello World” custom component. How to build custom JSF components is always a very popular topic and probably an entire book can be dedicated to just that. This simple example does a good job showing what goes into build a custom JSF component, I just wouldn’t use JSP as the view. The chapter continues with adding Ajax to a custom component and accessing resources. RichFaces CDK (Component Development Kit) is covered briefly as well. Towards the end, the chapters covers composite custom components which is a JSF 2 feature.

Chapter 6 – AJAX in JSF
The chapter covers Ajax and starts with new Ajax support in JSF 2. I liked that the first example showed how to use JSF 2 Ajax in programmatic way followed by the second example showing how to use f:ajax tag (for the same application). At the same time I was disappointed that the example was very basic (a button that generates a random number). I think I would prefer to see a more advanced or interesting usage.

Next example or recipe is using Dynamic Faces example. I’m not sure why Dynamic Faces extension was mentioned in the book, it looks like the last time this extension was updated was in 2006. There is also quick mention and screen shot of Woodstock component library. This library has been folded in IceFaces long time ago.

Next section covers RichFaces a4j:support tag. I think there is still some confusion out there, some believe ajax4jsf is a separate library (it was long time ago). ajax4jsf (or a4j) is just a tag library inside RichFaces, it’s not a separate library. The author mentions that a4j:support is available in RichFaces since 3.0. a4j:support tag was available even before RichFaces as part of Ajax4jsf project (at that point it was a separate project). This blog post describes Ajax4jsf and RichFaces history.

The next section covers Writing resuable Ajax component followed by a short section on PrimeFaces command link and command button controls. The PrimeFaces example is nice but also rather trivial in my opinion.

Chapter 7 – Internationalization and Localization
Chapter 7 covers Internationalization and Localization. The chapters provides good coverage and examples.

Chapter 8 – JSF, Images, CSS, and JS
This chapter covers JSF, Images, CSS, and JS. The first part covers how to apply CSS to JSF components. Good and useful examples using complex (standard) controls such as h:dataTable. The rest of the chapter shows how to use JavaScript with JSF. There are a number of interesting examples including using h:head onload attribute. The very last example demonstrates how to use rss4jsf project which enables RSS content in JSF page.

Chapter 9 – Managing and Testing
This chapters covers Managing and Testing and this is where I had the biggest surprised. The book covers one of the first JSF GUI tools called Faces Console. The problem is that the tool hasn’t been updated since 2004 and can only create JSF configuration files version 1.0 or 1.1. I’m not clear why a book on JSF 2 covers such an old tool. The rest of the chapter is better. It covers testing JSF applications with JUnit. It’s a popular topic and often asked on forums. The chapter end with inserting charts into a JSF page based on JFreeChart.

Chapter 10 – Facelets
Chapter 10 is a very good chapter which covers Facelets and its features.

Chapter 11 – JSF 2.0 Features
Chapter 11 is dedicated to JSF 2 features and includes examples which cover annotations, bookmarking, declarative event handling, navigation and view params.

Chapter 12 – Mixing JSF with Other Technologies
The last chapters talks about how to use JSF with other technologies such as Seam, Hibernate, Spring, and EJB. The chapter doesn’t show any real recipes or examples but just a very high level and brief overview of what other technologies could be used with JSF. I guess that’s fine as these technologies are outside the scope of the book.

Appendix – Configuring JSF-related Technologies
Finally the appendix shows how to configure (web.xml) various libraries and extensions used in this book.

Conclusion
Did I like the book? Yes, the book is good and loaded with useful recipes and code examples. However, the book doesn’t replace a regular book on JSF such as JSF 2, The Complete Reference. If you have been using JSF, then this book is a good next step. If you are a newbie, I’d recommend reading a regular JSF book first. Many recipes can be used with JSF 1.2 as they don’t use any special features from JSF 2, so that’s good. There are a just a number of things I would change. A number of examples mention JSP, with Facelets now included in JSF 2, I’m not sure if it really makes sense to cover JSP. Most JSF 1.2 project also use Facelets today. I just wouldn’t cover an old tool such as Faces Console as it hasn’t been updated since 2004. They are much better tools out today such as JBoss Tools with very good JSF 1.2 and 2 support. Libraries such as Dynamic Faces and Woodstock have also faded away long time ago.

But as I said before, it’s a great book, and a great resource for the JSF community.

Happy New Year.

Read the original blog entry...

More Stories By Max Katz

Max Katz heads Developer Relations for Appery.io, a cloud-based mobile app platform. He loves trying out new and cool REST APIs in mobile apps. Max is the author of two books “Practical RichFaces” (Apress 2008, 2011), DZone MVB (Most Valuable Blogger), and is a frequent speaker at developer conferences. You can find out what Max is up to on his blog: http://maxkatz.org and Twitter: @maxkatz.

IoT & Smart Cities Stories
Business professionals no longer wonder if they'll migrate to the cloud; it's now a matter of when. The cloud environment has proved to be a major force in transitioning to an agile business model that enables quick decisions and fast implementation that solidify customer relationships. And when the cloud is combined with the power of cognitive computing, it drives innovation and transformation that achieves astounding competitive advantage.
Nicolas Fierro is CEO of MIMIR Blockchain Solutions. He is a programmer, technologist, and operations dev who has worked with Ethereum and blockchain since 2014. His knowledge in blockchain dates to when he performed dev ops services to the Ethereum Foundation as one the privileged few developers to work with the original core team in Switzerland.
Machine learning has taken residence at our cities' cores and now we can finally have "smart cities." Cities are a collection of buildings made to provide the structure and safety necessary for people to function, create and survive. Buildings are a pool of ever-changing performance data from large automated systems such as heating and cooling to the people that live and work within them. Through machine learning, buildings can optimize performance, reduce costs, and improve occupant comfort by ...
René Bostic is the Technical VP of the IBM Cloud Unit in North America. Enjoying her career with IBM during the modern millennial technological era, she is an expert in cloud computing, DevOps and emerging cloud technologies such as Blockchain. Her strengths and core competencies include a proven record of accomplishments in consensus building at all levels to assess, plan, and implement enterprise and cloud computing solutions. René is a member of the Society of Women Engineers (SWE) and a m...
Early Bird Registration Discount Expires on August 31, 2018 Conference Registration Link ▸ HERE. Pick from all 200 sessions in all 10 tracks, plus 22 Keynotes & General Sessions! Lunch is served two days. EXPIRES AUGUST 31, 2018. Ticket prices: ($1,295-Aug 31) ($1,495-Oct 31) ($1,995-Nov 12) ($2,500-Walk-in)
IoT is rapidly becoming mainstream as more and more investments are made into the platforms and technology. As this movement continues to expand and gain momentum it creates a massive wall of noise that can be difficult to sift through. Unfortunately, this inevitably makes IoT less approachable for people to get started with and can hamper efforts to integrate this key technology into your own portfolio. There are so many connected products already in place today with many hundreds more on the h...
Digital Transformation is much more than a buzzword. The radical shift to digital mechanisms for almost every process is evident across all industries and verticals. This is often especially true in financial services, where the legacy environment is many times unable to keep up with the rapidly shifting demands of the consumer. The constant pressure to provide complete, omnichannel delivery of customer-facing solutions to meet both regulatory and customer demands is putting enormous pressure on...
Charles Araujo is an industry analyst, internationally recognized authority on the Digital Enterprise and author of The Quantum Age of IT: Why Everything You Know About IT is About to Change. As Principal Analyst with Intellyx, he writes, speaks and advises organizations on how to navigate through this time of disruption. He is also the founder of The Institute for Digital Transformation and a sought after keynote speaker. He has been a regular contributor to both InformationWeek and CIO Insight...
Digital Transformation: Preparing Cloud & IoT Security for the Age of Artificial Intelligence. As automation and artificial intelligence (AI) power solution development and delivery, many businesses need to build backend cloud capabilities. Well-poised organizations, marketing smart devices with AI and BlockChain capabilities prepare to refine compliance and regulatory capabilities in 2018. Volumes of health, financial, technical and privacy data, along with tightening compliance requirements by...
Andrew Keys is Co-Founder of ConsenSys Enterprise. He comes to ConsenSys Enterprise with capital markets, technology and entrepreneurial experience. Previously, he worked for UBS investment bank in equities analysis. Later, he was responsible for the creation and distribution of life settlement products to hedge funds and investment banks. After, he co-founded a revenue cycle management company where he learned about Bitcoin and eventually Ethereal. Andrew's role at ConsenSys Enterprise is a mul...