Return-Path: X-Original-To: apmail-struts-user-archive@www.apache.org Delivered-To: apmail-struts-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D705992A4 for ; Wed, 14 Dec 2011 20:22:04 +0000 (UTC) Received: (qmail 49328 invoked by uid 500); 14 Dec 2011 20:22:02 -0000 Delivered-To: apmail-struts-user-archive@struts.apache.org Received: (qmail 49248 invoked by uid 500); 14 Dec 2011 20:22:02 -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 49052 invoked by uid 99); 14 Dec 2011 20:22:02 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Dec 2011 20:22:02 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of anjibcs@hotmail.com designates 65.55.111.94 as permitted sender) Received: from [65.55.111.94] (HELO blu0-omc2-s19.blu0.hotmail.com) (65.55.111.94) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Dec 2011 20:21:53 +0000 Received: from BLU0-SMTP457 ([65.55.111.72]) by blu0-omc2-s19.blu0.hotmail.com with Microsoft SMTPSVC(6.0.3790.4675); Wed, 14 Dec 2011 12:21:32 -0800 X-Originating-IP: [146.243.44.97] X-Originating-Email: [anjibcs@hotmail.com] Message-ID: Received: from [146.243.44.97] ([146.243.44.97]) by BLU0-SMTP457.phx.gbl over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Wed, 14 Dec 2011 12:21:30 -0800 Date: Wed, 14 Dec 2011 15:21:28 -0500 From: Anjib Mulepati User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 To: Struts Users Mailing List Subject: use of validate() method [S 1.3.8] Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 14 Dec 2011 20:21:30.0315 (UTC) FILETIME=[F6FA91B0:01CCBA9D] Hi All, I have question regarding use of validate() method in Struts 1.3.8. I have simple form to collect couple of information (e.g. code and name) and have to add them to the Database. All database operations are handled by my DAO layer. Both code and name are unique in Database. So I want to validate code and name before calling INSERT SQL statement. Three methods I have in DAO layer are - Cutomer findByCode(String code); - Customer findByName (String name); - void createCustomer (Cutomer cust); So I am calling first two methods in validate() method and third one in execute() method. Is this a good way to do validation before inserting the record? Or there is better logic/design than this? I will be glad if anyone can answer my curiosity. Thanks, Anjib --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@struts.apache.org For additional commands, e-mail: user-help@struts.apache.org