You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Miguel Angel Mulero Martinez <mi...@mad.tecsidel.es> on 2002/10/03 13:51:11 UTC

RE: Populate form with ActionForm

Put a action in the middle. The action puts the bean in the request of the
second jsp. If the second jsp populates a form with this bean, you can pass
the actionform to the request instead of the bean and struts will populate
the form for you. The only requisite is that the action associated with the
form uses the actionform that you put in the request.

Regards.

-----Mensaje original-----
De: Miguel Angel Medina Lopez [mailto:mamedina@logic-factory.com]
Enviado el: jueves, 03 de octubre de 2002 13:53
Para: Struts Users Mailing List
Asunto: Populate form with ActionForm

Hi all:

I have an action that populate an ActionForm, when finish it forward to a
page that have a html form. Now I want to populate the input fields with the
value of the ActionForm. I have tried with different approaches but neither
works. Somebody have a solution?

Thank You in advance.

MAML


--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Populate form with ActionForm

Posted by Miguel Angel Mulero Martinez <mi...@mad.tecsidel.es>.
You must use a:
req.setAttribute("formname",form) in the middle action. Formname is the name
you give to the form in the struts-config.xml file, and form is the
ActionForm you will use to populate the jsp.

If this don't work, put here the struts-config.xml and the middle action.

Regards.

Miguel

-----Mensaje original-----
De: Miguel Angel Medina Lopez [mailto:mamedina@logic-factory.com]
Enviado el: jueves, 03 de octubre de 2002 14:36
Para: Miguel Angel Mulero Martinez; Struts Users Mailing List
Asunto: Re: Populate form with ActionForm

Thanks, but I thisk I'm doing that. My Action populate the actionForm and
put it in the request, then forward to a JSP that must use the actionForm to
populate the html form. That is the definition of the actions of this
scenario:

    <action path="/detallesEntidad"
           parameter="detalles"
           type="com.action.VehiculoAction"
           scope="request"
           attribute="entidadForm">
           <forward name="siguiente" path="/formularioDetalles.jsp"
redirect="false" />
    </action>
     <action path="/modificarEntidad"
         parameter="modificar"
         type="com.action.VehiculoAction"
         name="vehiculoForm"
         scope="request"
         input="/formularioDetalles.jsp"/>

And the JSP form tag is:

<html:form enctype="multipart/form-data" method="post"
action="/modificarEntidad.do">

I have followed the struts example, but the html form isn't populate. What's
the matter?

Thank You


----- Original Message -----
From: "Miguel Angel Mulero Martinez" <mi...@mad.tecsidel.es>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>; "Miguel
Angel Medina Lopez" <ma...@logic-factory.com>
Sent: Thursday, October 03, 2002 1:51 PM
Subject: RE: Populate form with ActionForm


> Put a action in the middle. The action puts the bean in the request of the
> second jsp. If the second jsp populates a form with this bean, you can
pass
> the actionform to the request instead of the bean and struts will populate
> the form for you. The only requisite is that the action associated with
the
> form uses the actionform that you put in the request.
>
> Regards.
>
> -----Mensaje original-----
> De: Miguel Angel Medina Lopez [mailto:mamedina@logic-factory.com]
> Enviado el: jueves, 03 de octubre de 2002 13:53
> Para: Struts Users Mailing List
> Asunto: Populate form with ActionForm
>
> Hi all:
>
> I have an action that populate an ActionForm, when finish it forward to a
> page that have a html form. Now I want to populate the input fields with
the
> value of the ActionForm. I have tried with different approaches but
neither
> works. Somebody have a solution?
>
> Thank You in advance.
>
> MAML
>
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Populate form with ActionForm

Posted by Miguel Angel Medina Lopez <ma...@logic-factory.com>.
Thanks, but I thisk I'm doing that. My Action populate the actionForm and
put it in the request, then forward to a JSP that must use the actionForm to
populate the html form. That is the definition of the actions of this
scenario:

    <action path="/detallesEntidad"
           parameter="detalles"
           type="com.action.VehiculoAction"
           scope="request"
           attribute="entidadForm">
           <forward name="siguiente" path="/formularioDetalles.jsp"
redirect="false" />
    </action>
     <action path="/modificarEntidad"
         parameter="modificar"
         type="com.action.VehiculoAction"
         name="vehiculoForm"
         scope="request"
         input="/formularioDetalles.jsp"/>

And the JSP form tag is:

<html:form enctype="multipart/form-data" method="post"
action="/modificarEntidad.do">

I have followed the struts example, but the html form isn't populate. What's
the matter?

Thank You


----- Original Message -----
From: "Miguel Angel Mulero Martinez" <mi...@mad.tecsidel.es>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>; "Miguel
Angel Medina Lopez" <ma...@logic-factory.com>
Sent: Thursday, October 03, 2002 1:51 PM
Subject: RE: Populate form with ActionForm


> Put a action in the middle. The action puts the bean in the request of the
> second jsp. If the second jsp populates a form with this bean, you can
pass
> the actionform to the request instead of the bean and struts will populate
> the form for you. The only requisite is that the action associated with
the
> form uses the actionform that you put in the request.
>
> Regards.
>
> -----Mensaje original-----
> De: Miguel Angel Medina Lopez [mailto:mamedina@logic-factory.com]
> Enviado el: jueves, 03 de octubre de 2002 13:53
> Para: Struts Users Mailing List
> Asunto: Populate form with ActionForm
>
> Hi all:
>
> I have an action that populate an ActionForm, when finish it forward to a
> page that have a html form. Now I want to populate the input fields with
the
> value of the ActionForm. I have tried with different approaches but
neither
> works. Somebody have a solution?
>
> Thank You in advance.
>
> MAML
>
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>