Yes that works!  Thanks.  

It does open the questions:

1) Why is it necessary?  I have dozens of Struts applications and this is
the first time this has been needed.
2) Why can't you specify the bean to use in the html:form tag?  I tried
adding the undocumented features name="MappingElement"
type="com.alarius.datasource.forms.MappingElement" with no effect. 


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: rahul [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, September 21, 2005 9:53 PM
To: Struts Users Mailing List; [EMAIL PROTECTED]
Subject: RE: Bean association with form

this might work -

        <html:form action="SaveMappingElement">
      <html:hidden property="actionStr" name="MappingElement"/>
      <html:hidden property="dataSourceUri" name="MappingElement"/>
      <html:hidden property="dataElementUri" name="MappingElement"/>


> -----Original Message-----
> From: Michael Oliver [mailto:[EMAIL PROTECTED]
> Sent: Thursday, September 22, 2005 4:37 AM
> To: 'Struts Users Mailing List'
> Subject: Bean association with form
>
>
> 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]
>
>




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

Reply via email to