Category: Programming
JSF Page Templates With Facelets
Templating is a very powerful feature for developing web applications with many pages that follow the same layout and design. This article demonstrates how to use facelets to create reusable templates for JSF pages.
Continue Reading...Comparing Constants Safely
When comparing two objects, the equals method is used to return true if they are identical. Typically, this leads to the following code : The problem here is that whether intended or not, it is quite possible that the name value is null, in which case a null pointer exception would be thrown. A better […]
Continue Reading...Immutability Through Interfaces
It is often desirable to have immutable objects, objects that cannot be modified once constructed. Typically, an immutable object has fields that are declared as final and are set in the object constructor. There are getters for the fields, but no setters since the values cannot be saved. Once created, the object state doesn’t change […]
Continue Reading...