Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

problem using struts

  Asked By: Charlie    Date: Jul 13    Category: Java    Views: 755
  

Using Struts :-

in my application, i have a jsp which when forwarded from an Action class,
will have dynamic number of fields in its form. Now how can I have a dynamic
Form Class to cater this, when the form in this jsp will be submitted ?

or i can not have it like this. and i have to do request.getParameters( ) in
my Action class.

give me some solution, if u have any...

your file upload solution was superb..... thanks for that...

Share: 

 

1 Answer Found

 
Answer #1    Answered By: Melissa King     Answered On: Jul 13

If I understand your question, here is a possible solution.

- Encapsulate all the input fields  in a Struts Action form  class
- In this class, have a Collection attribute to accept input from you
variable number  of fields. In Struts 1.1, Collections are
automatically manages by Struts.
- To display the collection in the JSP, and capture user input for the
collection, use tag iterate, possibly also tag nested.
- After form submit, in the Struts Action class  you only have to
iterate through the collection to get field values.

 
Didn't find what you were looking for? Find more on problem using struts Or get search suggestion and latest updates.




Tagged: