JSF Validations

Hi!

I am using f:validateDoubleRange for validating the number typed in a text field.I have specified the' minimum' attribute of this tag as 0.0001.

If I enter a value less than this it displays the error message

Value is less than allowable minimum of 0

However when I change 0.0001 to 0.001 (3 digits after decimal) it displays the correct message

Value is less than allowable minimum of 0.001

Is there any way by which I can prevent this round-off done so as to make use of the 4th digit after the decimal?

[555 byte] By [vasudevda] at [2007-11-27 7:31:24]
# 1

I looked at JSF 1.1_01 reference code and when it displays this message it uses the converter, set for this component, to show the value in the error message.

So my question is, do you have a converter (or use format of some sort) that truncates your output to 3 decimal places.

This is really a silly and stupid thing although I can see the arguments either way. If this is a problem for you then I would write my own validator (use method form) so you get a better error message.

smurray_eriea at 2007-7-12 19:11:37 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
Oh and if you don't have a converter read about javax.faces.convert.NumberConverter as you will get the default behavior. In this case, for decimal, it would be the standard set for javax.text.NumberFormat for the JVM.
smurray_eriea at 2007-7-12 19:11:37 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...