Replying to myself...

> -----Original Message-----
> From: Martin Cooper [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, September 19, 2002 3:24 PM
> To: 'Struts Users Mailing List'
> Subject: RE: [AGAIN] Duplicate values on both ActionForm error.
> 
> 
> 
> 
> > -----Original Message-----
> > From: Hoang, Hai [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, September 19, 2002 10:44 AM
> > To: 'struts-user'
> > Subject: [AGAIN] Duplicate values on both ActionForm error.
> > 
> > 
> > I've a master-detail page setup where the master page 
> > contains a number of
> > items with hyperlink to the detail page.   The problem 
> occurred when I
> > updating on the detail page and submit the update back to the 
> > database and
> > forward the request back to the master page.  Specifically, 
> > the property
> > value (called it actionName = "update") on the ActionForm of 
> > the detail page
> > forwards it value to the ActionForm of the master page.  Do 
> > you know why
> > this happens? Thanks.
> 
> This is just the way it works. If you forward a request using the
> RequestDispatcher (which is what you are doing - or rather, 
> what Struts is
> doing at your request), all of the original request 
> parameters are still
> present, because it's actually still the same request.
> 
> If your first action forwards to a URL that has additional 
> parameters in it,
> those parameters will be added to those in the original 
> request, so the
> combination of all of them will be seen by the second action.
> 
> The only way to avoid having the original parameters be 
> passed on to the
> second action is to use a redirect instead of a forward. The 
> main problem
> with that is that it costs you a round-trip back through the browser.

BTW, this is all explained in the Servlet spec:

http://java.sun.com/products/servlet/download.html

> 
> This is just one of the reasons that action chaining is not 
> recommended in
> Struts applications. There are many more - just as Craig. ;-)

I meant "just *ask* Craig"...

--
Martin Cooper


> 
> --
> Martin Cooper
> 
> 
> > 
> > 
> > ______________________________________________________________
> > ___________
> > Introducing the all new and improved continental.com.  With a 
> > totally new 
> > personalized design, it's the best place to go. Before you go.
> > 
> > Continental Airlines. Work Hard. Fly Right.
> > 
> > http://www.continental.com
> > 
> > 
> > --
> > To unsubscribe, e-mail:   
> > <mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail: 
> > <mailto:[EMAIL PROTECTED]>
> > 
> > 
> 
> 
> --
> To unsubscribe, e-mail:   
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: 
> <mailto:[EMAIL PROTECTED]>
> 
> 


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to