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 3F82D4274 for ; Tue, 31 May 2011 02:38:27 +0000 (UTC) Received: (qmail 12947 invoked by uid 500); 31 May 2011 02:38:24 -0000 Delivered-To: apmail-struts-user-archive@struts.apache.org Received: (qmail 12924 invoked by uid 500); 31 May 2011 02:38:24 -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 12915 invoked by uid 99); 31 May 2011 02:38:24 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 31 May 2011 02:38:24 +0000 X-ASF-Spam-Status: No, hits=3.7 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of kenshin520@gmail.com designates 209.85.215.48 as permitted sender) Received: from [209.85.215.48] (HELO mail-ew0-f48.google.com) (209.85.215.48) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 31 May 2011 02:38:17 +0000 Received: by ewy22 with SMTP id 22so2206798ewy.35 for ; Mon, 30 May 2011 19:37:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=6hInwRHlYvOeL+sBq7iPAIKedstF3Pfb7msE+gdQeNs=; b=hO1/IccRAhWrjmNsm6GnevOGhyAS+aH28Xys/WPwepK2m4LLiK6gSAsVAgrtfwzu3P F5QyOeLJyq4hbsos3/H3GyIBu4872gO2j+wSDvjyZ1eU3xVreax8fUAvik4pJTpHZNEz YzOhlp4R05QjLfwLvRJKcaURT9PwUO+o5PFl8= 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=WlMPbx5x0Vu0nl6+y0Lg+vA4BBGo7/F5tAZNRq57w3Op9ylsuS/ZmQKlu3yb45AT5R 6GpOa9mB0yYW3gQ9rQvpxAXcJuAwFgvngw+Da9REEgxgiIWzvHficD3bPM9pZtq7m07i IQ8pwXQQbAkGu98cBxhgjtxG7+sApBVWHwh2A= MIME-Version: 1.0 Received: by 10.14.27.130 with SMTP id e2mr1393544eea.233.1306809476116; Mon, 30 May 2011 19:37:56 -0700 (PDT) Received: by 10.14.32.196 with HTTP; Mon, 30 May 2011 19:37:56 -0700 (PDT) In-Reply-To: <4DE4087E.3050702@gmail.com> References: <4DE4087E.3050702@gmail.com> Date: Tue, 31 May 2011 10:37:56 +0800 Message-ID: Subject: Re: chain or redirectAction ResultType From: Steven Yang To: Struts Users Mailing List Content-Type: multipart/alternative; boundary=bcaec52be91d9cf39304a4894af9 X-Virus-Checked: Checked by ClamAV on apache.org --bcaec52be91d9cf39304a4894af9 Content-Type: text/plain; charset=ISO-8859-1 chaining is not recommended. basically as you have observed, chaining is a server-side redirect. you go to another page without changing client's browser url. i have not seen a formal argument of the bad of it (or i forgot) but what i have observed is that the user may hit Reload on browser and get unexpected behavior for both the user and developer On Tue, May 31, 2011 at 5:13 AM, Sachin Lale wrote: > Hi, > I am migrating an application from struts1.1 to struts 2.2.3. I have two > action > > 1. InstitutuionAction : The purpose is to prepare the data required > to display and then forward to a Institution.JSP (using tiles) > 2. InstitutionAddEditAction: This action exposed two methods insert, > update and validate. > > The insert and validate method of InstitutionAddEditAction class looks like > below > > public String insert() throws Exception > { > log.info("In > InstitutionStrutsAddEditAction"+institution.getName()); > return Action.SUCCESS; > } > > public void validate() > { > if(institution.getName().equals("abc")) > addActionError(" Invalid Name ."); > } > > struts.xml > > class="edu.wustl.clinportal.action.struts2.InstitutionStruts2Action"> > .clinportal.institutionDef > .clinportal.institutionDef > /ManageAdministrativeData.do > > class="edu.wustl.clinportal.action.struts2.InstitutionStrutsAddEditAction"> > > Institution > add > pageOfInstitution > 2 > > > Institution > > > > After a validation error it is getting redirect to Institution.action but > not re-populating the data entered by the users obvious reason as the > request is redirected and not forward. Everything works fine if i replace > the result type to chain and could populate the Institution name (this > object is in InstitutionAddEditAction class). > > I added a Institution object in InstitutuionAction class. I tried the same > scenarion using chain this time. Its worked as well. Is ChainInterceptor > populating this object? > > But is using chain a recommended approach. What is harm in using chain.? > > Best regards, > Sachin > > --bcaec52be91d9cf39304a4894af9--