You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Dustin Sallings <ds...@2wire.com> on 2003/07/03 02:00:53 UTC
Resource problem displaying validator error arguments
Hello *,
Summary: My arguments are always showing up as null (even when its'
not a resource), but the message itself is coming out of the resources
just fine.
I'm having a problem I'm presently unable to figure out. I've got the
following validator rules:
<field property="serialNumber" depends="maxlength,biginteger">
<arg0 key="fields.serialNumber" resource="false" />
<arg1 name="maxlength" key="${var:maxlength}"
resource="false"/>
<var>
<var-name>maxlength</var-name>
<var-value>12</var-value>
</var>
</field>
<field property="snDirection" depends="required,mask">
<arg0 key="fields.serialNumberPart" /> <var>
<var-name>mask</var-name>
<var-value>^(start|end)$</var-value>
</var>
</field>
Relevant resource properties are as follows:
errors.biginteger={0} does not contain a valid number.
errors.invalid={0} is not valid.
fields.serialNumber=Serial number
fields.serialNumberPart=Serial number part
The first one uses a validator I implemented that verifies the input
can be converted to a big integer. The second is using mask. Both of
these are correctly doing their validation, however, both of them
return null for arg0.
html:errors produces the following when the input is not valid:
null does not contain a valid number.
null is not valid.
What could I have possibly done to accomplish this?
Same thing on 1.1rc2 and 1.1.
Thanks.
--
Dustin Sallings
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: Resource problem displaying validator error arguments
Posted by Adam Hardy <ah...@cyberspaceroad.com>.
Hi Dusty, I have a similar problem as well. I'll be interested in any
replies. Out of curiosity, what are you using BigInteger for?
Adam
Dustin Sallings wrote:
>
> Hello *,
>
> Summary: My arguments are always showing up as null (even when its'
> not a resource), but the message itself is coming out of the resources
> just fine.
>
> I'm having a problem I'm presently unable to figure out. I've got
> the following validator rules:
>
> <field property="serialNumber" depends="maxlength,biginteger">
> <arg0 key="fields.serialNumber" resource="false" />
> <arg1 name="maxlength" key="${var:maxlength}" resource="false"/>
> <var>
> <var-name>maxlength</var-name>
> <var-value>12</var-value>
> </var>
> </field>
> <field property="snDirection" depends="required,mask">
> <arg0 key="fields.serialNumberPart" /> <var>
> <var-name>mask</var-name>
> <var-value>^(start|end)$</var-value>
> </var>
> </field>
>
> Relevant resource properties are as follows:
>
> errors.biginteger={0} does not contain a valid number.
> errors.invalid={0} is not valid.
>
> fields.serialNumber=Serial number
> fields.serialNumberPart=Serial number part
>
>
> The first one uses a validator I implemented that verifies the input
> can be converted to a big integer. The second is using mask. Both of
> these are correctly doing their validation, however, both of them return
> null for arg0.
>
> html:errors produces the following when the input is not valid:
>
> null does not contain a valid number.
> null is not valid.
>
> What could I have possibly done to accomplish this?
>
> Same thing on 1.1rc2 and 1.1.
>
> Thanks.
>
> --
> Dustin Sallings
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org