Welcome!

Java IoT Authors: Carmen Gonzalez, Yeshim Deniz, Elizabeth White, Pat Romanski, Liz McMillan

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
At CloudEXPO Silicon Valley, June 24-26, 2019, Digital Transformation (DX) is a major focus with expanded DevOpsSUMMIT and FinTechEXPO programs within the DXWorldEXPO agenda. Successful transformation requires a laser focus on being data-driven and on using all the tools available that enable transformation if they plan to survive over the long term. A total of 88% of Fortune 500 companies from a generation ago are now out of business. Only 12% still survive. Similar percentages are found throug...
Atmosera delivers modern cloud services that maximize the advantages of cloud-based infrastructures. Offering private, hybrid, and public cloud solutions, Atmosera works closely with customers to engineer, deploy, and operate cloud architectures with advanced services that deliver strategic business outcomes. Atmosera's expertise simplifies the process of cloud transformation and our 20+ years of experience managing complex IT environments provides our customers with the confidence and trust tha...
Where many organizations get into trouble, however, is that they try to have a broad and deep knowledge in each of these areas. This is a huge blow to an organization's productivity. By automating or outsourcing some of these pieces, such as databases, infrastructure, and networks, your team can instead focus on development, testing, and deployment. Further, organizations that focus their attention on these areas can eventually move to a test-driven development structure that condenses several l...
The graph represents a network of 1,329 Twitter users whose recent tweets contained "#DevOps", or who were replied to or mentioned in those tweets, taken from a data set limited to a maximum of 18,000 tweets. The network was obtained from Twitter on Thursday, 10 January 2019 at 23:50 UTC. The tweets in the network were tweeted over the 7-hour, 6-minute period from Thursday, 10 January 2019 at 16:29 UTC to Thursday, 10 January 2019 at 23:36 UTC. Additional tweets that were mentioned in this...
Over the course of two days, in addition to insightful conversations and presentations delving into the industry's current pressing challenges, there was considerable buzz about digital transformation and how it is enabling global enterprises to accelerate business growth. Blockchain has been a term that people hear but don't quite understand. The most common myths about blockchain include the assumption that it is private, or that there is only one blockchain, and the idea that blockchain is...
Never mind that we might not know what the future holds for cryptocurrencies and how much values will fluctuate or even how the process of mining a coin could cost as much as the value of the coin itself - cryptocurrency mining is a hot industry and shows no signs of slowing down. However, energy consumption to mine cryptocurrency is one of the biggest issues facing this industry. Burning huge amounts of electricity isn't incidental to cryptocurrency, it's basically embedded in the core of "mini...
In his general session at 19th Cloud Expo, Manish Dixit, VP of Product and Engineering at Dice, discussed how Dice leverages data insights and tools to help both tech professionals and recruiters better understand how skills relate to each other and which skills are in high demand using interactive visualizations and salary indicator tools to maximize earning potential. Manish Dixit is VP of Product and Engineering at Dice. As the leader of the Product, Engineering and Data Sciences team at D...
The term "digital transformation" (DX) is being used by everyone for just about any company initiative that involves technology, the web, ecommerce, software, or even customer experience. While the term has certainly turned into a buzzword with a lot of hype, the transition to a more connected, digital world is real and comes with real challenges. In his opening keynote, Four Essentials To Become DX Hero Status Now, Jonathan Hoppe, Co-Founder and CTO of Total Uptime Technologies, shared that ...
At CloudEXPO Silicon Valley, June 24-26, 2019, Digital Transformation (DX) is a major focus with expanded DevOpsSUMMIT and FinTechEXPO programs within the DXWorldEXPO agenda. Successful transformation requires a laser focus on being data-driven and on using all the tools available that enable transformation if they plan to survive over the long term. A total of 88% of Fortune 500 companies from a generation ago are now out of business. Only 12% still survive. Similar percentages are found throug...
Every organization is facing their own Digital Transformation as they attempt to stay ahead of the competition, or worse, just keep up. Each new opportunity, whether embracing machine learning, IoT, or a cloud migration, seems to bring new development, deployment, and management models. The results are more diverse and federated computing models than any time in our history.