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]

Reply via email to