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
>
>

Reply via email to