Some JSF notes

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

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

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.

Advertisements

One Response to Some JSF notes

  1. I do accept as true with all of the ideas you’ve introduced to your post. Click https://twitter.com/moooker1

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: