commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daggumalli, Sivaji" <>
Subject RE: [Validator] how to give user input in Arg
Date Wed, 16 Nov 2005 23:25:07 GMT
Sorry to confuse you Niall. Actually we are using Commons Validator as
standalone project. (Not with Struts). I was wrongly mentioned that
earlier by mistake.

Is it possible to extend commons Validator 1.2.0 to achieve this

Regards and Thanks in advance.

-----Original Message-----
From: Niall Pemberton [] 
Sent: Wednesday, November 16, 2005 5:14 PM
To: Jakarta Commons Developers List
Subject: Re: [Validator] how to give user input in Arg

There is no way to do this in Struts/Validator currently - unless you
your own versions of the Struts validators and implement a mechanism to
this when generating the error message.


----- Original Message ----- 
From: "Daggumalli, Sivaji" <>
Sent: Wednesday, November 16, 2005 10:04 PM


Afternoon got a commons Validator problem...

We are using the Struts Validator and in my validation.xml i have:

<form name="myForm">

<field property="dateOfBirth" depends="required, date">
<arg0 key="x.dateOfBirth"/>


In Application Resources i have:{0} is not a date.
x.dateOfBirth=Date Of Birth

If the user entered date is in the wrong format an error message is

Date Of Birth is not a date. This is all good. But what I am trying to
achieve is including the input value in the message. I know in the
validation.xml you can specify and use vars in the error message (for

<arg1 key="${var:minlength}"
name="minlength" resource="false" />

What I want to do is replace the <var-value> (the literal vaue '10')
with the user input. I have tried many things

${field:dateOfBirth}, ${dateOfBirth}, ${myForm.dateOfBirth} but none
have worked.

Regards and Thanks in advance,


To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message