[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: loading form fields into collections



Or....you could use Struts and it will do it for you ;)
 
You can (declaratively....e.g. xml config file) setup the bean (called an ActionForm) that will be populated from the request.
Struts will hand you the bean as an argument when it calls the execute method on a class that you've defined.  You can then do the business logic (or call a service on the biz tier) and then forward to your jsp (or however you decide to render).
 
It's makes the web developers life much easier.

Good luck!!!!

 

James Mitchell
Software Engineer\Struts Evangelist
Struts-Atlanta, the "Open Minded Developer Network"
http://www.open-tools.org/struts-atlanta


-----Original Message-----
From: Poorav Chaudhari [mailto:pooravc@yahoo.com]
Sent: Wednesday, September 25, 2002 4:29 PM
To: ajug-members@ajug.org
Subject: loading form fields into collections

In my jsp form, i have lots of similar fields. After submit when i want to read the fields from the actionform, i have to go through each field. Since all the fields are processed similarly i would rather write a loop and process the field values.

Right now what i have to do is
sField = form.getsField1();
//start processing
//....
//end processing

sField = form.getsField2();
//start processing
//....
//end processing

sField = form.getsField1();
//start processing
//....
//end processing
... and so on.

this gets me

suggestions please. thank you.



Poorav Chaudhari



Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!