Some JSF notes

March 31, 2007

While working on the JSF tutorials, I observed a few things:

We can change the error messages for reqired fields by changing or creating our own and pointing to it from the faces-config.xml file. Messages for the properties we do not change will continue to be served form

In a custom Validator we can set the severity of error messages. I tried setting the severity of a error message to Severity.ERROR, but it resulted in a compilation error. The correct constant was FacesMessage.SEVERITY_ERROR. Hmmmm I would have thought Severity.ERROR was a better choice… especially since it already exists in the Severity class.

To use a custom converter we have to use the tag <f:converter …> but to use one of the default converters like the DateTimeConverter we use another tag <f:convertDateTime …> I think they should have just used the f:converter tag and supplied some default converters for us. This would have kept the tag library simpler and uniform.

JSF Tutorials

March 31, 2007

When I stated learning JSF, I searched the net for good tutorials. The tutorials offered by Netbeans are a good starting point, however they focus on creating a JSF project using the Netbeans IDE. If you are using another IDE, you may have to go around the Netbeans specific stuff.