Oh! yes, thanks for pointing that out. It works smoothly. Apologies for the silly mistake.
Regards, Maithily. On Mon, Jun 27, 2011 at 6:03 PM, Dave Newton <davelnew...@gmail.com> wrote: > From http://struts.apache.org/1.2.4/userGuide/dev_validator.html > > * minlength - validate input data isn't less than a specified minimum > length. Requires a minlength variable. > > <field property="name" depends="required,minlength"> > <arg0 key="customer.name"/> > <arg1 name="minlength" key="${var:minlength}" resource="false"/> > <var><var-name>minlength</var-name><var-value>3</var-value></var> > </field> > > So, it's a colon there. > > Dave > > On Mon, Jun 27, 2011 at 8:31 AM, Maithily <maithily.koh...@gmail.com> > wrote: > > Yeah, it renders as you have said. > > > > I have declared the var as per the struts validator documents. > > > > <field property="password" depends="required,minlength"> > > <arg position="0" key="LoginForm.password"/> > > <arg position="1" name="minlength" key="${var.minlength}" > > resource="false"/> > > <var> > > <var-name>minlength</var-name> > > <var-value>6</var-value> > > </var> > > </field> > > > > I also tried this configuring it like this - > > > > <field property="password" depends="required,minlength"> > > <arg0 key="LoginForm.password"/> > > <arg1 name="minlength" key="${var.minlength}" > > resource="false"/> > > <var> > > <var-name>minlength</var-name> > > <var-value>6</var-value> > > </var> > > </field> > > > > None of them seem to work for me. Could any lib file be missing which is > not > > able to interpret teh ${...} expression? > > > > > > > > On Mon, Jun 27, 2011 at 5:51 PM, Dave Newton <davelnew...@gmail.com> > wrote: > > > >> Oh, you're saying that the error message *renders* as "... less than > >> ${var.minlength} characters"? > >> > >> What happens when you declare the var as ${var:minlength} as in the > docs? > >> > >> Dave > >> > >> On Mon, Jun 27, 2011 at 8:17 AM, Maithily <maithily.koh...@gmail.com> > >> wrote: > >> > Thanks for the reply Dave. > >> > > >> > The default error message configured as follows > >> > errors.minlength={0} can not be less than {1} characters. > >> > > >> > Regards, > >> > Maithily > >> > > >> > On Mon, Jun 27, 2011 at 4:30 PM, Dave Newton <davelnew...@gmail.com> > >> wrote: > >> > > >> >> {1} like the default message. > >> >> > >> >> Dave > >> >> On Jun 27, 2011 3:14 AM, "Maithily" <maithily.koh...@gmail.com> > wrote: > >> >> > Hi, > >> >> > > >> >> > I am new to this mailing list and am facing a problem using the > >> >> "minlength" > >> >> > field validation provided by the Struts Validation Framework. > >> >> > Struts version - 1.2.4 > >> >> > Application Server - Apache Tomcat (5.5) > >> >> > > >> >> > I have configured the following in my validation.xml file - > >> >> > > >> >> > <field property="password" depends="required,minlength"> > >> >> > <arg position="0" key="LoginForm.password"/> > >> >> > <arg position="1" name="minlength" key="${var.minlength}" > >> >> > resource="false"/> > >> >> > <var> > >> >> > <var-name>minlength</var-name> > >> >> > <var-value>6</var-value> > >> >> > </var> > >> >> > </field> > >> >> > > >> >> > However, the value of the minlength variable is not being > substituted > >> in > >> >> > the error message and the following is displayed when the > validation > >> >> fails > >> >> - > >> >> > > >> >> > > >> >> > Password can not be less than ${var.minlength} characters. > >> >> > > >> >> > I have searched through the mailing list archives but could not > find a > >> >> > solution. Pl. advise what could go wrong. > >> >> > > >> >> > Thanks and Regards, > >> >> > Maithily. > >> >> > >> > > >> > >> --------------------------------------------------------------------- > >> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > >> For additional commands, e-mail: user-h...@struts.apache.org > >> > >> > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > >