Welcome!

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

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
@DevOpsSummit at Cloud Expo, taking place November 12-13 in New York City, NY, is co-located with 22nd international CloudEXPO | first international DXWorldEXPO and will feature technical sessions from a rock star conference faculty and the leading industry players in the world. The widespread success of cloud computing is driving the DevOps revolution in enterprise IT. Now as never before, development teams must communicate and collaborate in a dynamic, 24/7/365 environment. There is no time t...
CloudEXPO New York 2018, colocated with DXWorldEXPO New York 2018 will be held November 11-13, 2018, in New York City and will bring together Cloud Computing, FinTech and Blockchain, Digital Transformation, Big Data, Internet of Things, DevOps, AI, Machine Learning and WebRTC to one location.
The Internet of Things will challenge the status quo of how IT and development organizations operate. Or will it? Certainly the fog layer of IoT requires special insights about data ontology, security and transactional integrity. But the developmental challenges are the same: People, Process and Platform and how we integrate our thinking to solve complicated problems. In his session at 19th Cloud Expo, Craig Sproule, CEO of Metavine, demonstrated how to move beyond today's coding paradigm and sh...
The best way to leverage your Cloud Expo presence as a sponsor and exhibitor is to plan your news announcements around our events. The press covering Cloud Expo and @ThingsExpo will have access to these releases and will amplify your news announcements. More than two dozen Cloud companies either set deals at our shows or have announced their mergers and acquisitions at Cloud Expo. Product announcements during our show provide your company with the most reach through our targeted audiences.
What are the new priorities for the connected business? First: businesses need to think differently about the types of connections they will need to make – these span well beyond the traditional app to app into more modern forms of integration including SaaS integrations, mobile integrations, APIs, device integration and Big Data integration. It’s important these are unified together vs. doing them all piecemeal. Second, these types of connections need to be simple to design, adapt and configure...
Cell networks have the advantage of long-range communications, reaching an estimated 90% of the world. But cell networks such as 2G, 3G and LTE consume lots of power and were designed for connecting people. They are not optimized for low- or battery-powered devices or for IoT applications with infrequently transmitted data. Cell IoT modules that support narrow-band IoT and 4G cell networks will enable cell connectivity, device management, and app enablement for low-power wide-area network IoT. B...
In his session at 21st Cloud Expo, Raju Shreewastava, founder of Big Data Trunk, provided a fun and simple way to introduce Machine Leaning to anyone and everyone. He solved a machine learning problem and demonstrated an easy way to be able to do machine learning without even coding. Raju Shreewastava is the founder of Big Data Trunk (www.BigDataTrunk.com), a Big Data Training and consulting firm with offices in the United States. He previously led the data warehouse/business intelligence and Bi...
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.
Contextual Analytics of various threat data provides a deeper understanding of a given threat and enables identification of unknown threat vectors. In his session at @ThingsExpo, David Dufour, Head of Security Architecture, IoT, Webroot, Inc., discussed how through the use of Big Data analytics and deep data correlation across different threat types, it is possible to gain a better understanding of where, how and to what level of danger a malicious actor poses to an organization, and to determin...
Cloud-enabled transformation has evolved from cost saving measure to business innovation strategy -- one that combines the cloud with cognitive capabilities to drive market disruption. Learn how you can achieve the insight and agility you need to gain a competitive advantage. Industry-acclaimed CTO and cloud expert, Shankar Kalyana presents. Only the most exceptional IBMers are appointed with the rare distinction of IBM Fellow, the highest technical honor in the company. Shankar has also receive...