Re: Translation of fieldName in annotated validations

2013-12-20 Thread JOSE L MARTINEZ-AVIAL
Hi, Just reviewing old things, I discovered I didn't answer you. The think is that the same effect can be obtained using the already existing functionality. I can create the following annotation to validate a field: @RequiredStringValidator(type = ValidatorType.SIMPLE, fieldName =

Re: Translation of fieldName in annotated validations

2013-09-30 Thread Lukasz Lenart
2013/9/25 JOSE L MARTINEZ-AVIAL jlm...@gmail.com: Well, I have found a workaround that is not much of a hacking. The annotations has a messageParameters that is evaluated against the valuestack. Since the action is in the valuestack, and it implements ActionSupport,I can pass a parameter that

Re: Translation of fieldName in annotated validations

2013-09-25 Thread Lukasz Lenart
2013/9/25 JOSE L MARTINEZ-AVIAL jlm...@gmail.com: Hello, I have an Action that receives a parameter *email *on a bean *event*. So basically the parameter is send to the server with name * event.email=jlmagcatgmail.com*'. The bean and the parameter are created correctly, so this part works

Re: Translation of fieldName in annotated validations

2013-09-25 Thread JOSE L MARTINEZ-AVIAL
Yes, what I would like is to define a message for each validator that could be reused with any field just by having the fieldname translated. Let's say I have a form to create an user, with fields First name, Last name and Email, where all the fields are required. I would define the following

Re: Translation of fieldName in annotated validations

2013-09-25 Thread Chris
-AVIAL jlm...@gmail.com À : Struts Users Mailing List user@struts.apache.org Envoyé le : Mercredi 25 septembre 2013 12h51 Objet : Re: Translation of fieldName in annotated validations Yes, what I would like is to define a message for each validator that could be reused with any field just by having

Re: Translation of fieldName in annotated validations

2013-09-25 Thread JOSE L MARTINEZ-AVIAL
De : JOSE L MARTINEZ-AVIAL jlm...@gmail.com À : Struts Users Mailing List user@struts.apache.org Envoyé le : Mercredi 25 septembre 2013 12h51 Objet : Re: Translation of fieldName in annotated validations Yes, what I would like is to define a message for each validator that could be reused

Re: Translation of fieldName in annotated validations

2013-09-25 Thread Chris
...@yahoo.fr Envoyé le : Mercredi 25 septembre 2013 14h54 Objet : Re: Translation of fieldName in annotated validations 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

Re: Translation of fieldName in annotated validations

2013-09-25 Thread Lukasz Lenart
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

Re: Translation of fieldName in annotated validations

2013-09-25 Thread JOSE L MARTINEZ-AVIAL
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}

Re: Translation of fieldName in annotated validations

2013-09-25 Thread JOSE L MARTINEZ-AVIAL
I just created the issue https://issues.apache.org/jira/browse/WW-4208. I maybe able to provide a patch for this, if I have time for it. 2013/9/25 JOSE L MARTINEZ-AVIAL jlm...@gmail.com I will open a ticket. My idea is to add a parameter to the annotation called keyArgs, which would be a

Re: Translation of fieldName in annotated validations

2013-09-25 Thread JOSE L MARTINEZ-AVIAL
Well, I have found a workaround that is not much of a hacking. The annotations has a messageParameters that is evaluated against the valuestack. Since the action is in the valuestack, and it implements ActionSupport,I can pass a parameter that is a call to getText. requiredStrings =

Translation of fieldName in annotated validations

2013-09-24 Thread JOSE L MARTINEZ-AVIAL
Hello, I have an Action that receives a parameter *email *on a bean *event*. So basically the parameter is send to the server with name * event.email=jlmagcatgmail.com*'. The bean and the parameter are created correctly, so this part works ok. Now I want to validate the input using annotations.