Return-Path: Delivered-To: apmail-jakarta-struts-user-archive@jakarta.apache.org Received: (qmail 2447 invoked by uid 500); 27 Aug 2001 11:26:32 -0000 Mailing-List: contact struts-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk Reply-To: struts-user@jakarta.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list struts-user@jakarta.apache.org Received: (qmail 2426 invoked from network); 27 Aug 2001 11:26:32 -0000 Received: from web12106.mail.yahoo.com (216.136.172.26) by daedalus.apache.org with SMTP; 27 Aug 2001 11:26:32 -0000 Message-ID: <20010827112628.95758.qmail@web12106.mail.yahoo.com> Received: from [217.162.132.97] by web12106.mail.yahoo.com; Mon, 27 Aug 2001 04:26:28 PDT Date: Mon, 27 Aug 2001 04:26:28 -0700 (PDT) From: Jan Sorensen Subject: Re: Dynamic forwardings... To: struts-user@jakarta.apache.org In-Reply-To: <025a01c12ee2$30b9e3e0$27a3e9c7@gates> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N I think Ted is saying that you can add a property to your ActionForm, and use this property instead of the parameter. So before forwarding you have to set this new property, and then forward as normal. He is also saying the you can populate the property from a hidden field when submitting a jsp-form. Hope this helps, Jan Sorensen --- David Corbin wrote: > I understand the first choice presented below. But > I don't understand the > second choice. I think I fail to fully understand > ActionForm. Are you > saying that if I have a populated ActionForm, then > all of those arguments > get "passed on" when I forward to another action? > > ----- Original Message ----- > From: "Ted Husted" > To: > Sent: Sunday, August 26, 2001 9:11 PM > Subject: Re: Dynamic forwardings... > > > > You can construct ActionForwards from scratch, and > I have seen people > > include query strings with that. > > > > > http://www.mail-archive.com/struts-user@jakarta.apache.org/msg14224.html > > > > Personally, I would think about adding these > parameters as hidden fields > > to the ActionForm, use the form instead, and > forget about the > > parameters. Struts automatically populates the > ActionForm from the > > parameters. > > > > It would also populate the same or different > ActionForm for the second > > ActionMapping if you forwarded the request. > > > > David Corbin wrote: > > > > > > I'm not sure where I'm miscommunication, so I'll > go back to the > beginning. > > > > > > I have an action "list". It expects an > parameter "tableID", so a link > to it > > > looks like > "http://host/app/list.do?tableID=foo", and if things > are > > > successful, returns a page with a list of items > that depend on the > tableID. > > > For each item, there is a link generated for > action "blue" that > specifies > > > two parameters: tableID & itemID > > > > (http://host/app/blue.do?tableID=foo&itemID=xyzzy). > > > > > > No problem. > > > > > > The action "blue" requires the two parameters > "tableID" and "itemID". > Under > > > certain circumstances, the results of the action > blue require that > > > "list.do?tableID=foo" be "forwarded". Struts > doesn't seem to provide a > way > > > to handle this last case. If it does, I don't > understand it. > > > > > > David > > > ----- Original Message ----- > > > From: "Ted Husted" > > > To: > > > Sent: Sunday, August 26, 2001 7:14 PM > > > Subject: Re: Dynamic forwardings... > > > > > > > Typically, there would be a finite number of > inputs, and you could > have > > > > a logical forward for each one. > > > > > > > > The ActionMappings form an API for the legal > entry points to the > > > > application. > > > > > > > > Usually, the only thing that is truly dynamic > is a reference into a > data > > > > source, to look something up. In that case, > the link tag can take one > or > > > > more dynamic parameters, based on the > collection of beans used to > write > > > > it. > > > > > > > > In that case, the action usually gets the > parameters from the request, > > > > and uses them to look up whatever is required. > > > > > > > > David Corbin wrote: > > > > > > > > > > I'm definately talking about "forward", but > my "whatever" value is > > > dynamic. > > > > > It's based on input (a parameter) into the > action. I don't yet > > > understand > > > > > the best solution for that. > > > > > > > > > > ----- Original Message ----- > > > > > From: "Ted Husted" > > > > > To: > > > > > Sent: Sunday, August 26, 2001 2:56 PM > > > > > Subject: Re: Dynamic forwardings... > > > > > > > > > > > For a forward, you just put in an encoded > query string for the > path: > > > > > > > > > > > > > > > > > > path="/do/item/Add?code=whatever"/> > > > > > > > > > > > > For an action mapping, you can use the > parameter property > > > > > > > > > > > > > > > > > path="/do/item/Add" > > > > > > ... > > > > > > parameter="add"> > > > > > > > > > > > > > > > > > > and have the action check for the code > there > > > > > > > > > > > > String code = mapping.getParameter(); > > > > > > > > > > > > > > > > > > David Corbin wrote: > > > > > > > > > > > > > > I've got a an action "add", which > requires a an argument "code". > > > > > > > One (at least) of the possible forwards > needs to specify this > "code" > > > on > > > > > the > > > > > > > forward URL. > > > > > > > > > > > > > > How can I do that? > > > > > > > > > > > > > > Thanks > > > > > > > David Corbin > > > > > __________________________________________________ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/