Welcome!

Java IoT Authors: Liz McMillan, Yeshim Deniz, Zakia Bouachraoui, Elizabeth White, William Schmarzo

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
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...
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...
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...
Dynatrace is an application performance management software company with products for the information technology departments and digital business owners of medium and large businesses. Building the Future of Monitoring with Artificial Intelligence. Today we can collect lots and lots of performance data. We build beautiful dashboards and even have fancy query languages to access and transform the data. Still performance data is a secret language only a couple of people understand. The more busine...
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.
Whenever a new technology hits the high points of hype, everyone starts talking about it like it will solve all their business problems. Blockchain is one of those technologies. According to Gartner's latest report on the hype cycle of emerging technologies, blockchain has just passed the peak of their hype cycle curve. If you read the news articles about it, one would think it has taken over the technology world. No disruptive technology is without its challenges and potential impediments t...
If a machine can invent, does this mean the end of the patent system as we know it? The patent system, both in the US and Europe, allows companies to protect their inventions and helps foster innovation. However, Artificial Intelligence (AI) could be set to disrupt the patent system as we know it. This talk will examine how AI may change the patent landscape in the years to come. Furthermore, ways in which companies can best protect their AI related inventions will be examined from both a US and...
Bill Schmarzo, Tech Chair of "Big Data | Analytics" of upcoming CloudEXPO | DXWorldEXPO New York (November 12-13, 2018, New York City) today announced the outline and schedule of the track. "The track has been designed in experience/degree order," said Schmarzo. "So, that folks who attend the entire track can leave the conference with some of the skills necessary to get their work done when they get back to their offices. It actually ties back to some work that I'm doing at the University of San...
When talking IoT we often focus on the devices, the sensors, the hardware itself. The new smart appliances, the new smart or self-driving cars (which are amalgamations of many ‘things'). When we are looking at the world of IoT, we should take a step back, look at the big picture. What value are these devices providing. IoT is not about the devices, its about the data consumed and generated. The devices are tools, mechanisms, conduits. This paper discusses the considerations when dealing with the...
Bill Schmarzo, author of "Big Data: Understanding How Data Powers Big Business" and "Big Data MBA: Driving Business Strategies with Data Science," is responsible for setting the strategy and defining the Big Data service offerings and capabilities for EMC Global Services Big Data Practice. As the CTO for the Big Data Practice, he is responsible for working with organizations to help them identify where and how to start their big data journeys. He's written several white papers, is an avid blogge...