From user-return-218766-archive-asf-public=cust-asf.ponee.io@struts.apache.org Sat Jan 6 13:25:47 2018 Return-Path: X-Original-To: archive-asf-public@eu.ponee.io Delivered-To: archive-asf-public@eu.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by mx-eu-01.ponee.io (Postfix) with ESMTP id F34CB18062C for ; Sat, 6 Jan 2018 13:25:46 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id E339F160C3C; Sat, 6 Jan 2018 12:25:46 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 5A9AF160C3B for ; Sat, 6 Jan 2018 13:25:46 +0100 (CET) Received: (qmail 48150 invoked by uid 500); 6 Jan 2018 12:25:45 -0000 Mailing-List: contact user-help@struts.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Struts Users Mailing List" Reply-To: "Struts Users Mailing List" Delivered-To: mailing list user@struts.apache.org Received: (qmail 73596 invoked by uid 99); 6 Jan 2018 10:37:41 -0000 X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 3.724 X-Spam-Level: *** X-Spam-Status: No, score=3.724 tagged_above=-999 required=6.31 tests=[DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_ENVFROM_END_DIGIT=0.25, FROM_MISSPACED=0.001, FROM_MISSP_EH_MATCH=2, NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_LOW=-0.7, SPF_SOFTFAIL=0.972] autolearn=disabled MIME-Version: 1.0 Message-ID: Subject: Re: Annotation validation setter level References: From: "Hedju Hor" In-Reply-To: Content-Type: text/plain; charset="iso-8859-1" x-ponymail-sender: ab61ef8effb1d3873d2731b313ebc695c8a33c70 Date: Sat, 06 Jan 2018 10:37:38 -0000 x-ponymail-agent: PonyMail Composer/0.2 To: X-Mailer: LuaSocket 3.0-rc1 Hi, use @VisitorFieldValidator 1. in Action-Class annotad gettter Method of the model with @VisitorFieldValidator 2. @EmailValidator on getter in Model Person.getEmail see https://depressedprogrammer.wordpress.com/2007/05/10/struts-2-validation-using-annotations/ Regards Hedju Hor On 2018-01-05 19:50, José Antonio Delgado Trujillo wrote: > Annotations validations an alternative way of XML validation or the simplest way to implement the validate method. > > Yo have two options: > At method level > At setter level > > In the second if you don’t have the setter in the Action class because it is a property of an object, where do i put the annotation. I think it would be in the model class but it doesn’t work. > > I explain better with a example. > Person class have email property and the action class has a field of Person’s type. So the setter method is for Person not for email. If i want to use @EmailValidator in a setter level where does it put the annotation? > > > Un saludo, > José A. > > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@struts.apache.org For additional commands, e-mail: user-help@struts.apache.org