struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Huber <gregh3...@gmail.com>
Subject Re: Changes on the validator field-validator required
Date Fri, 23 Feb 2018 14:17:58 GMT
I checked, and double value comes from ongl,  and yes it wont be a null, so
does not get validated.  I get the struts error though.  I have had to
change all my form beans to be Doubles.
https://struts.apache.org/core-developers/required-validator.html could do
with an update warning no not to use primitives.

Cheers Greg

Cheers Greg

On 23 February 2018 at 12:51, Yasser Zamani <yasserzamani@apache.org> wrote:

>
>
> On 2/23/2018 2:40 PM, Greg Huber wrote:
> > We use  <field-validator type="required"> validator to make sure null is
> > not passed, but if I use a double it does not now validate, it wants a
> > Double for it to work.
> >
> > Has there been any changes, or has it always been like this?
>
> Did you mean it works in some versions as you expect?
>
> I think the primitive type double, cannot be null at all in java and
> automatically will be initialized to 0 by java i.e. you don't need a
> null validator in such situations. The non-primitive type Double, can.
> This may explain why when you change your type to Double it starts working.
>
> Regards.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message