• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to send list of objects from jsp to struts action class.

 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have a problem while sending list of values from jsp to struts action class.My requirement is as follows.
I have table in jsp ,with in that i have one <tr> and within that i have 7 text fields(like <tr><td></td>......</tr>).And under this table i have two buttons "Add Row" and "Delete Row". If i click on "Add Row" button dynamically another row is added to this table.There is no problem on this.But if i enter values with in those fileds and when i submit the button the request goes to Action class.with in that i got only values from first row of the table.I didn't get the second row values.Is there anyway to get all the values from jsp to action class.
can someone suggest me on this.

Thanks,
SNEHITHAPRASAD


 
Ranch Hand
Posts: 55
Mac Hibernate Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It depends on the logic you have applied in your Action class.
Also how you are trying to display multiple rows in your jsp.
Normally for handling multiple Lists we use

inside the Iterator tag.
Setting indexed="true" sets an unique index to your scripting variable.
Its needs some explanation and right now I don't have much time.
Anyways I am trying for a simpler solution, just be patient.
I'll get back to you as soon as possible.
For any clarification reply back to me.

Regards,
Sandy

 
Ranch Hand
Posts: 329
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Prasad,
Have you checked out struts FAQ for indexed properties. You would also be intrested in the startup reading links provided in the same place.

 
reply
    Bookmark Topic Watch Topic
  • New Topic