Murry, Thanks but NO as I think you suspected you DO NOT need to put the ".do" on the end, the <html:form...> tag looks in the struts-config.xml to find the action. I have more than a dozen struts applications all working fine and even other forms within the problematic application also working fine. As a matter of fact adding the name attribute to the input tags also got this problematic form working.
I just don't know why the MappingElement bean did not associate with the form tag. Michael Oliver CTO Alarius Systems LLC 6800 E. Lake Mead Blvd, #1096 Las Vegas, NV 89156 Phone:(702)643-7425 Fax:(702)974-0341 *Note new email changed from [EMAIL PROTECTED] -----Original Message----- From: Murray Collingwood [mailto:[EMAIL PROTECTED] Sent: Friday, September 23, 2005 3:58 PM To: user@struts.apache.org Subject: RE: Bean association with form Hi Michael Okay, I'm starting to understand the problem.... let's look back at the JSP <html:form action="SaveMappingElement"> Disclaimer: I know there are lots of variations in how you can use Struts, so some of what I'm saying is from my app that works and how the coding differs from yours. Yours may not be wrong, it maybe just different to mine, but how different does it need to be before it becomes wrong, I'm not sure about. It could be that your form is not being identified as an action in your struts-config.xml. I'm guessing your action servlet setting is something like "*.do", in which case your action on the form needs to reflect "*.do". Try: <html:form action="/SaveMappingElement.do"> Also, in your struts-config.xml you have lots of actions (which is normal). You only specify the name="{form-bean}" on the action that will receive one of these forms. For example, <action path="/ShowTheAddPage" type="..." scope="request"> <forward.../> </action> <action path="/ProcessTheAddPage" type="..." name="MappingElement" scope="request"> <forward.../> </action> Kind regards mc On 23 Sep 2005 at 6:13, Michael Oliver wrote: > I guess I didn't include all from struts-config.xml that I needed to > include. > > Here is the full portion of the configuration for all the actions > relating to the MappingElement > > They all have the name="MappingElement" > > <action name="MappingElement" path="/EditMappingElement" > type="com.alariusj.verdx.actions.EditMappingElement"> > <forward name="mappingElementForm" path="/pages/MappingElementForm.jsp"/> > </action> > > <action name="MappingElement" path="/DeleteMappingElement" > type="com.alarius.datasource.actions.EditMappingElement"/> > > <action name="MappingElement" path="/SaveMappingElement" > type="com.alariusj.verdx.actions.SaveMappingElement"> > <forward name="showVerdXDataSourceDescriptor" > path="/ShowVerdXDataSourceDescriptor.do"/> > </action> > > So I am still at a loss as to why the bean was not getting associated > with the html:form tag. > Adding the name attribute to the input tags works but WOULD be > redundant if the html:form tag was working properly. > > > > Michael Oliver > CTO > Alarius Systems LLC > 6800 E. Lake Mead Blvd, #1096 > Las Vegas, NV 89156 > Phone:(702)643-7425 > Fax:(702)974-0341 > *Note new email changed from [EMAIL PROTECTED] > > -----Original Message----- > From: news [mailto:[EMAIL PROTECTED] On Behalf Of Laurie Harper > Sent: Thursday, September 22, 2005 4:40 PM > To: user@struts.apache.org > Subject: Re: Bean association with form > > As long as you have your mappings setup correctly (and use the right > attribute name if you push the form bean into the request/session > yourself), the <html:form> tag locates the appropriate form bean > automatically and the name attribute is redundant. > > L. > > Murray Collingwood wrote: > > Laurie is right, you need the extra action mapping in your config file. > > > > I have also been adding the attribute name to the form elements as in: > > <html:hidden name="MappingElement" property="actionStr"/> > > > > Is this necessary? It works but I'm wondering if it is redundant? > > > > Kind regards > > mc > > > > > > On 22 Sep 2005 at 15:44, Laurie Harper wrote: > > > > > >>You have your action path set to /EditMappingElement but your form > >>action is SaveMappingElement. There's no link between the form and > >>the form-bean. You need to make sure you have an action mapping for > >>SaveMappingElement, and that it has name="MappingElement" set. > >> > >>L. > >> > >>Michael Oliver wrote: > >> > >>>I have an Form called MappingElement, > >>> > >>>From struts-config.xml > >>> > >>><form-bean name="MappingElement" > >>>type="com.alarius.datasource.forms.MappingElement"/> > >>> > >>>I have an Action that opens a jsp page with a form on it and > >>>populates > the > >>>MappingElement bean with data. > >>> > >>>From EditMappingElement.java > >>> > >>>public ActionForward execute(ActionMapping mapping, ActionForm form, > >>> HttpServletRequest request, HttpServletResponse > >>>response) > >>> throws Exception { > >>> ActionForward forward = mapping.findForward(FORWARD_mappingElement); > >>> MappingElement me = (MappingElement) form; > >>> > >>> DataSourceServices dss = new DataSourceServices(); > >>> AccessToken token = new AccessToken(ajcc); > >>> ServiceResponse sr = dss.RetrieveMappingElement(token, me > >>> .getDataElementUri()); > >>> form = me = (MappingElement) sr.getMappingElement(); > >>> request.setAttribute("MappingElement", me); > >>> > >>> return forward; > >>>} > >>> > >>>From Struts-config.xml > >>> > >>><action name="MappingElement" path="/EditMappingElement" > >>> type="com.alariusj.verdx.actions.EditMappingElement"> > >>> <forward name="mappingElementForm" > > > > path="/pages/MappingElementForm.jsp"/> > > > >>></action> > >>> > >>>From MappingElementForm.jsp > >>> > >>><logic:present name="MappingElement">MappingElement present<br> > >>><bean:write name="MappingElement" property="dataSourceUri"/><br> > >>><bean:write name="MappingElement" property="dataElementName"/><br> > >>></logic:present> > >>> > >>> <html:form action="SaveMappingElement"> > >>> <html:hidden property="actionStr"/> > >>> <html:hidden property="dataSourceUri"/> > >>> <html:hidden property="dataElementUri"/> > >>> > >>>When I run it the SaveMappingElement form is not populated but the > >>>MappingElement bean is present and the bean:writes show the data > >>>that is populated. > >>> > >>>Why doesn't the html:form tag pick up the MappingElement bean? > >>> > >>>Ollie > >> > >> > >>-------------------------------------------------------------------- > >>- To unsubscribe, e-mail: [EMAIL PROTECTED] > >>For additional commands, e-mail: [EMAIL PROTECTED] > >> > >> > >> > >>-- > >>No virus found in this incoming message. > >>Checked by AVG Anti-Virus. > >>Version: 7.0.344 / Virus Database: 267.11.4/109 - Release Date: > >>21/09/2005 > >> > > > > > > > > > > FOCUS Computing > > Mob: 0415 24 26 24 > > [EMAIL PROTECTED] > > http://www.focus-computing.com.au > > > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > > -- > No virus found in this incoming message. > Checked by AVG Anti-Virus. > Version: 7.0.344 / Virus Database: 267.11.4/109 - Release Date: > 21/09/2005 > FOCUS Computing Mob: 0415 24 26 24 [EMAIL PROTECTED] http://www.focus-computing.com.au -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.344 / Virus Database: 267.11.4/109 - Release Date: 21/09/2005 --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]