----- Original Message -----
From: "Jim Bruno Goldberg" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, November 26, 2002 6:27 PM
Subject: perform() or execute()?


> Hi, people!
>
> I am trying to develop a little system in struts for 3 weeks now and I
> can't solve some (very basic) problems. I try read the documentations,
> but some I can resolve anyway. Please, I need some help!
> My questions:
>
> 1. When I try to use the execute() in a Action, the method is nota
> called. When I try with perform() works fine, but I known this is
> deprecaced..... (I try struts 1.0.2 and now struts 1.1 - same result).

The  method has been deprecated since struts 1.1: so it can't work in struts
1.0.2

> 2. I try to prepopulate a form (request scope) and does not works. I
> try to set: request.setAttribute("myfield","myvalue"), and nothing.

To populate a form from an action, you need to cast the ActionForm passed as
parameter to the perform (or execute) method of your action and then, set
the different properties to the appropriate values:
for example:

MyForm myForm = (MyForm) form;
myForm.setMyField("myValue");

> 3. To prepopulate a Form, I must to call a Action, prepopulate a bean
> and then call a Form? That right?

I don't know what you mean with "call a Form".
You just need to set the properties of the form with the values you want
Then, the taglib will display the values in the field of the form, on your
JSP.

>
> Please, I need some help. Thanks to all.
>

Hope it helps
Patrice


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

Reply via email to