It does a good job if the user enters something that is not convertible to a long.

However, when you enter nothing and leave the Job ID field blank, JSF does a not so nice job of converting the value to 0 (zero) while you were expecting a null value.
Check out following articles as well as how-to solve this:
http://balusc.blogspot.com/2008/07/dao-tutorial-use-in-jsf.html#EmptyToNullConverter
http://tomcat.apache.org/tomcat-6.0-doc/config/systemprops.html#Expression_Language
I tested with the solution from BalusC's blog but a custom converter didn't even help solving the issue on tomcat6.
So the option left is to add following startup parameter to tomcat's launch configuration and use the standard jsf converter as mentioned on top of this article.
No comments:
Post a Comment