Re: specifying multiple forms in an action mapping
There's more about the dotted syntax here: http://jakarta.apache.org/struts/api/org/apache/struts/taglib/bean/package-summary.html#doc.Properties under Property References. Like Struts-Bean tags, the property attribute for the Struts-HTML tags accept simple, nested, and indexed expressions. For example, this tag: html:text property=mailingAddress.street/ corresponds to: getMailingAddress().getStreet() John Yu wrote: Ted, Could you elaborate a bit more on the dotted syntax and how to create a single ActionForm wrapping around other forms? You wrote on Mon, 09 Jul 2001 14:06:07 -0700: The short answer is you can't. Though, you could create a single ActionForm as a wrapper around other forms and then access them through the infamous dotted syntax. If that doesn't work for you, if you talked a bit more about why you want multiple forms, someone may have a better answer ;-)
Re: specifying multiple forms in an action mapping
On Wed, 4 Jul 2001, Narasimhan, Shyamala wrote: hi i would like to use two different forms in an action class... kindly advise as to how to specify the action mapping Although it is not possible to have 1 form beans per action *mapping*, it is definitely possible to have 1 form beans per action *class*. You simply have to have more than one mapping that resolves to the same Action class name. Note that, in this scenario, Struts will still create a separate instance of the Action class per mapping. Therefore, if you want to share data between them, you'll need to use static variables, or some other equivalent technique. thanks shyamala. Craig McClanahan
RE: specifying multiple forms in an action mapping
Purely using the struts-config.xml/struts tags, it is not possible to have two forms for one mapping. But why do you need this? I suppose you want one HTML form to populate two form beans, is this right? My suggestion then would be to either give up on this idea or to have a third form that encapsulates the two others, while exposing both set of properties. Fr. -Original Message- From: Grassotti, Michael [mailto:[EMAIL PROTECTED]] Sent: 09 July 2001 22:27 To: [EMAIL PROTECTED] Subject: RE: specifying multiple forms in an action mapping Has anyone gotten back to you on this? I'm having the same problem... -Original Message- From: Narasimhan, Shyamala [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 04, 2001 9:21 AM To: [EMAIL PROTECTED] Subject: specifying multiple forms in an action mapping hi i would like to use two different forms in an action class... kindly advise as to how to specify the action mapping thanks shyamala. The information in this email is confidential and is intended solely for the addressee(s). Access to this email by anyone else is unauthorised. If you are not an intended recipient, you must not read, use or disseminate the information contained in the email. Any views expressed in this message are those of the individual sender, except where the sender specifically states them to be the views of Capco. http://www.capco.com ***
RE: specifying multiple forms in an action mapping
Has anyone gotten back to you on this? I'm having the same problem... -Original Message- From: Narasimhan, Shyamala [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 04, 2001 9:21 AM To: [EMAIL PROTECTED] Subject: specifying multiple forms in an action mapping hi i would like to use two different forms in an action class... kindly advise as to how to specify the action mapping thanks shyamala.
Re: specifying multiple forms in an action mapping
The short answer is you can't. Though, you could create a single ActionForm as a wrapper around other forms and then access them through the infamous dotted syntax. If that doesn't work for you, if you talked a bit more about why you want multiple forms, someone may have a better answer ;-) -- Ted Husted, Husted dot Com, Fairport NY USA. -- Custom Software ~ Technical Services. -- Tel 716 737-3463. -- http://www.husted.com/about/struts/ Grassotti, Michael wrote: Has anyone gotten back to you on this? I'm having the same problem... -Original Message- From: Narasimhan, Shyamala [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 04, 2001 9:21 AM To: [EMAIL PROTECTED] Subject: specifying multiple forms in an action mapping hi i would like to use two different forms in an action class... kindly advise as to how to specify the action mapping thanks shyamala.
Re: specifying multiple forms in an action mapping
If what you want is to have one Action class that can handle input from multiple forms, then you just need to add a different action mapping in struts-config.xml for each input form, giving each a distinct path. In the Action itself, you would need to check to see which kind of form (or which path) you were being invoked with. For example: action path=/path1 name=form1 type=com.mycompany.MyAction/ action path=/path2 name=form2 type=com.mycompany.MyAction/ would allow you to process requests for '/path1' or '/path2' with the same Action class. Hope this helps. -- Martin Cooper - Original Message - From: Narasimhan, Shyamala [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, July 04, 2001 6:21 AM Subject: specifying multiple forms in an action mapping hi i would like to use two different forms in an action class... kindly advise as to how to specify the action mapping thanks shyamala.