You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Mohamed SIDI <mh...@gmail.com> on 2011/05/11 10:38:35 UTC
create own annotation
Hi all,
I'm using struts2 annotation validation mecanisme, I have a problem with
credit card validation, I should develop my own annotation for this issue,
someone can help me to do that, or explain me the steps ?
thanks
--
Cordialement
Mohamed
Re: create own annotation
Posted by Mohamed SIDI <mh...@gmail.com>.
Hi Dav,
I have done what you suggest, witch is developing my custom validator and
reuse it in my annotation, that works well
@CustomValidator(type ="customCreditCardValidator", fieldName =
"creditCard", message = "invalid credi card number", parameters =
{@ValidationParameter(name = "creditCard",value =
"creditCard"),@ValidationParameter(name = "required",value = "true" )})
thanks.
2011/5/11 Jim Talbut <Ji...@groupgti.com>
> Don't miss out on just implementing a validation method directly in your
> action.
> Unless you are going to reuse the validation code is it worth the effort of
> writing an annotation?
>
> Jim
>
> -----Original Message-----
> From: Mohamed SIDI [mailto:mhm.sidi@gmail.com]
> Sent: 11 May 2011 09:39
> To: Struts Users Mailing List
> Subject: create own annotation
>
> Hi all,
>
> I'm using struts2 annotation validation mecanisme, I have a problem with
> credit card validation, I should develop my own annotation for this issue,
> someone can help me to do that, or explain me the steps ?
>
> thanks
>
> --
>
>
> Cordialement
>
> Mohamed
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
--
Cordialement
Mohamed
RE: create own annotation
Posted by Jim Talbut <Ji...@groupgti.com>.
Don't miss out on just implementing a validation method directly in your action.
Unless you are going to reuse the validation code is it worth the effort of writing an annotation?
Jim
-----Original Message-----
From: Mohamed SIDI [mailto:mhm.sidi@gmail.com]
Sent: 11 May 2011 09:39
To: Struts Users Mailing List
Subject: create own annotation
Hi all,
I'm using struts2 annotation validation mecanisme, I have a problem with
credit card validation, I should develop my own annotation for this issue,
someone can help me to do that, or explain me the steps ?
thanks
--
Cordialement
Mohamed
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: create own annotation
Posted by Dave Newton <da...@gmail.com>.
You'll want a custom validator, which you can configure with an annotation.
Dave
On May 11, 2011 4:39 AM, "Mohamed SIDI" <mh...@gmail.com> wrote:
> Hi all,
>
> I'm using struts2 annotation validation mecanisme, I have a problem with
> credit card validation, I should develop my own annotation for this issue,
> someone can help me to do that, or explain me the steps ?
>
> thanks
>
> --
>
>
> Cordialement
>
> Mohamed