I will open a ticket. My idea is to add a parameter  to the annotation
called keyArgs, which would be a String array. It would be used as follows:

        requiredStrings =
            {@RequiredStringValidator(type = ValidatorType.SIMPLE,
                    keyArgs={"email","one","two"}
                    fieldName = "event.email", key =
"validation-error.mandatory")},

Then the key/message could be something like this:

validation-error.mandatory = The field ${getText(keyArgs[0])} is mandatory

It would allow to customize the message even further than it allows now. I
suppose it would need to be implemented also in xml validations, but I
haven't used them, so I don't what would be needed for that.




2013/9/25 Lukasz Lenart <lukaszlen...@apache.org>

> 2013/9/25 JOSE L MARTINEZ-AVIAL <jlm...@gmail.com>:
> > I have javascript controls for the client-side validation, but we also
> want
> > to implement server-side validation. I'm not criticizing the framework, I
> > really really like it. I'm just wondering if the validations could be a
> > little more flexible to allow reusing message properties.
>
> I think yes, it is possible - please register an issue and we think
> about that, maybe attach some demo or even patch.
>
>
> Regards
> --
> Ɓukasz
> + 48 606 323 122 http://www.lenart.org.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

Reply via email to