Return-Path: Delivered-To: apmail-struts-user-archive@www.apache.org Received: (qmail 42574 invoked from network); 14 Sep 2009 19:21:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 14 Sep 2009 19:21:27 -0000 Received: (qmail 15785 invoked by uid 500); 14 Sep 2009 19:21:25 -0000 Delivered-To: apmail-struts-user-archive@struts.apache.org Received: (qmail 15729 invoked by uid 500); 14 Sep 2009 19:21:25 -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 15719 invoked by uid 99); 14 Sep 2009 19:21:24 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Sep 2009 19:21:24 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of poulwiel@gmail.com designates 209.85.211.202 as permitted sender) Received: from [209.85.211.202] (HELO mail-yw0-f202.google.com) (209.85.211.202) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Sep 2009 19:21:16 +0000 Received: by ywh40 with SMTP id 40so4836705ywh.8 for ; Mon, 14 Sep 2009 12:20:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=YDW8iuWrrgLBvYIyYtCu69ekk2eWlewA4Hx7BiWIBNE=; b=R0Qiw+3O08FjPI7fJpjjHAz1fmKZt6Wdcx6CuKl2ss7c4UBu9OulI55eURQ2RnoTKB 6df8L+joz/j0FgL3ClzEXuPyX52mjAg+hTQ16/WWbkinq8vpyPv3Oclt1XTbiSWjNx0g f5iewyS67t1zw0qQe7QyisuZ4TvzS29/LucC4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=rfNJX7WFDH/pFBCTK3FusdibXf+S8MI29mB0vYEZG5IoiZqSER7OeUQJP7YxJxN9xk vBmxLSI+O7hnaN2ScTGgYaho5HtPG8dGvtze8ft5dRVEOqBF+s4uaXJyW5iEoqT1mBjv y59XoKoGjHOG0tFLY/7Ql5XuwzxLsFMknwUCs= MIME-Version: 1.0 Received: by 10.91.153.15 with SMTP id f15mr4049227ago.77.1252956055931; Mon, 14 Sep 2009 12:20:55 -0700 (PDT) In-Reply-To: References: Date: Mon, 14 Sep 2009 17:20:55 -0200 Message-ID: <5e5424000909141220q79ef6582m3b99690e78072490@mail.gmail.com> Subject: Re: Struts 1 - Initialization versus validation From: =?ISO-8859-2?Q?Pawe=B3_Wielgus?= To: Struts Users Mailing List Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org Hi Kevin, as far as i know form.reset(...) should be used to reset form fields, one good example is checkbox field that needs to be reseted. I don't know if using reset method in order to initialize objects in form. Can You do it with some kind of initialize/prepare method in SetupAction or CrudAction? Best greetings, Pawel Wielgus. 2009/9/14, Kevin Hale Boyes : > I have a setup action defined: > > type="package.SetupAction" > name="MyForm" validate="false"> > > > > This action is responsible for setting up values in my (dyna) form > before getting to the JSP page. > > I have a second action which is where the JSP will POST to: > > type="package.CrudAction" > name="MyForm" validate="true" input="/setup"> > > > > > The idea is that if a validation error occurs then I'll be forwarded > back the setup action > and the page will be displayed again. On success of the form POST I > will actually > come back to the same page to allow the user to input and POST again. > > The validation error could either happen from the (client-side) > validator framework or > it could happen from the CrudAction when it returns to > mapping.getInputForward(). > > Here's my problem though. I would like to initialize the form fields > (form.reset()) when > the user first comes to the page or for success navigations but don't > want to reset the > form when coming to the action as a result of an error. > > Is there any way to do that? > > As noted in the subject, this is on Struts 1 and I'm using > struts-validation. > > Thanks, > Kevin. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org > For additional commands, e-mail: user-help@struts.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@struts.apache.org For additional commands, e-mail: user-help@struts.apache.org