Return-Path: Mailing-List: contact struts-user-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list struts-user@jakarta.apache.org Received: (qmail 32614 invoked from network); 1 Feb 2001 00:04:59 -0000 Received: from patan.sun.com (192.18.98.43) by h31.sny.collab.net with SMTP; 1 Feb 2001 00:04:59 -0000 Received: from taller.eng.sun.com ([129.144.251.34]) by patan.sun.com (8.9.3+Sun/8.9.3) with ESMTP id QAA06576 for ; Wed, 31 Jan 2001 16:05:05 -0800 (PST) Received: from eng.sun.com (d-ucup02-251-159 [129.144.251.159]) by taller.eng.sun.com (8.9.3+Sun/8.9.3/ENSMAIL,v2.0) with ESMTP id QAA16372 for ; Wed, 31 Jan 2001 16:05:04 -0800 (PST) Message-ID: <3A78A880.F4DC3E20@eng.sun.com> Date: Wed, 31 Jan 2001 16:06:24 -0800 From: "Craig R. McClanahan" X-Mailer: Mozilla 4.76 [en]C-CCK-MCD {Sony} (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: struts-user@jakarta.apache.org Subject: Re: Is "request" shared across a redirect? References: <4.3.2.7.2.20010131142738.02ab9c48@lucy.riskmetrics.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N James Howe wrote: > I have two JSP pages which I want to have share a bean. In the first JSP > page I do something like this: > > [...] > > > > [...] > > In "foo.jsp", I have code which looks like this: > > [...] > >

Message not available

>
> > >

>
> [...] > > When I invoke the first page, I make the transition to the second page, but > the bean property is never found. I've debugged the code and it appears > that the request object used by the second page does not have the attribute > defined by the first page. I guess I thought that objects put into the > request scope were maintained across a redirection. Was I wrong or am I > just doing something stupid? > Request scope objects are retained across a *forward* but not across a *redirect*. The reason is that a redirect is actually a message sent back to the browser, which then submits a second request to the new URL. The request attributes are not shared because it is not the same request any longer. Session scope objects, on the other hand, would be retained across the redirect. > > Thanks. Craig