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 95E5CD4AE for ; Tue, 31 Jul 2012 22:21:01 +0000 (UTC) Received: (qmail 67187 invoked by uid 500); 31 Jul 2012 22:20:59 -0000 Delivered-To: apmail-struts-user-archive@struts.apache.org Received: (qmail 67159 invoked by uid 500); 31 Jul 2012 22:20:59 -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 67149 invoked by uid 99); 31 Jul 2012 22:20:59 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 31 Jul 2012 22:20:59 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FSL_RCVD_USER,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of paulus.benedictus@gmail.com designates 209.85.212.48 as permitted sender) Received: from [209.85.212.48] (HELO mail-vb0-f48.google.com) (209.85.212.48) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 31 Jul 2012 22:20:52 +0000 Received: by vbjk17 with SMTP id k17so7617881vbj.35 for ; Tue, 31 Jul 2012 15:20:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=qLgNJSl967bDv8dtnBpfPWg9panDYAyz3ETFXQTw0Hs=; b=YxOKCiSe+a+QULNL50QWdqw9/Lp9Uldkck+sZsoj1sLMxRNfFByRexBWpo7eHBLH9t hh7lgdo5YcVUdHNs5Gs7YJZUgksfY9EvRZEswsReztm4hOmqJd27TAwoeVz4QpxE1TGb ErDa9JnnGg389WEJoLSfqQppgZbY5aSA3dyu7ZGPhBeflsnnRhOJVey376gBhmsUZKKt eYiubhq5EUKmrsDwbvPjp7szgqdPsxwr86oHn+CnxD8vhHLD4/W8QuD4Nfk2bMfMskWn bFtBFyC10sueELKhEWAFo4nBzbxOjzfOd5nAadBS76l9nVAXizCwnHrALxtsykHR1MFy 4MVQ== MIME-Version: 1.0 Received: by 10.52.98.3 with SMTP id ee3mr8309470vdb.127.1343773231378; Tue, 31 Jul 2012 15:20:31 -0700 (PDT) Sender: paulus.benedictus@gmail.com Received: by 10.220.103.67 with HTTP; Tue, 31 Jul 2012 15:20:31 -0700 (PDT) In-Reply-To: References: Date: Tue, 31 Jul 2012 17:20:31 -0500 X-Google-Sender-Auth: Qs0x0lDaxWeXK75K2gqAqG7TnBY Message-ID: Subject: Re: Form data lost [S 1.3.8] From: Paul Benedict To: Struts Users Mailing List Content-Type: text/plain; charset=ISO-8859-1 I think you're losing the data because you're unintentionally creating a new form. Make sure both actions refer to the form with the same scope. On Tue, Jul 31, 2012 at 11:09 AM, Anjib Mulepati wrote: > Hi All, > > I am using large form to input data. I have some validation code as well as > I have condition where if something goes wrong in execution of action it > will take the user back to the form. > My problem is when validation fail or form returned from action execution > all my form data are lost. How can I have form retain its data even after > fail? > I am using struts tag for form and session scope for form. > > focus="agentVersion"> > > > tabindex="1" titleKey="title.agentVersion" value="" /> >
> > ........ > > > >
> > > type="com.anjib.actions.agencyadmin.CreateAgentAction" > input="/showCreateAgent.do" > name="CreateAgentForm" > scope="session" > > > > > > type="com.anjib.actions.agencyadmin.ShowCreateAgentAction"> > > > > > public class CreateAgentForm extends org.apache.struts.action.ActionForm { > .............................. > > public ActionErrors validate(ActionMapping mapping, HttpServletRequest > request) { > ActionErrors errors = new ActionErrors(); > if (getAgentName() == null || getAgentName().length() < 1) { > errors.add("createAgent", new > ActionMessage("error.agentName.required")); > } > ................................................. > return errors; > } > } > > Thanks, > Anjib > > --------------------------------------------------------------------- > 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