Well, if you configure your action with a proper form, the form would
already be passed to you in your action method.  Simply cast ActionForm to
the TestActionForm, and populate it as you did.  You don't have to set it
into the request since that's done for you automatically.

Good Luck.

-AP_
http://www.myprofiles.com/member/profile/apara_personal

-----Original Message-----
From: Karim Saloojee [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 02, 2002 11:04 AM
To: [EMAIL PROTECTED]
Subject: How to pre-populate forms without being able to get direct
access to their names or scope. Am I missing something?


Hi

I am having a bit of a problem understanding how exactly to pre-populate a
form bean. It seems there is no way to get the name of the formbean of my
next JSP or the session it is likely to be in.

I know that I could do it like this:
    TestActionForm tf = new TestActionForm();
    tf.setEmployeeNo("55525");
    tf.setName("compaq");
    request.setAttribute("testactionform", tf);

This would prepopulate my next JSP with no problems. However any changes to
bean names/scope in my struts-config.xml would require a change in my
classes where the above code would be.

This feels a bit strange, am I doing something wrong or not following the
best practice?

TIA,
Karim



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



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

Reply via email to