• Post Reply Bookmark Topic Watch Topic
  • New Topic

JSP-Bean question  RSS feed

 
Adrian Muscalu
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,
In a JSP page I have to collect the same data type belonging to a variable number of persons. I can place the components (first name, last name, etc) in a "for" statement to display x times but I don't know how to collect them in a bean.
Can anybody point me in the right direction?
Thank you in advance.
Regards,
Adrian
 
greg philpott
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
every thing in its place.
create a class like this:

and use this bean in your class - have an array of them.
then your loop will look something like this:

so your loop is short and your data is in its bean.
[ March 16, 2002: Message edited by: greg philpott ]
 
Adrian Muscalu
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure th above solution will suit me... I was looking for something like "press the SUBMIT button and all the data in the jsp page to fill firstName[], lastName[], etc" in the bean. It works just fine for textboxes; if I have multiple textboxes with the same name on a page and the correspondent method in the bean to receive an array instead of a simple String, all it's done automatically. With one exception. The radio objects. This is because if multiple radio objects have the same name, only one value will be submitted. I couldn't find a solution for the radio objects.
I would appreciate any help in this direction, I've already spent too much time for this problem.
Best regards,
Adrian
[ March 18, 2002: Message edited by: Adrian Muscalu ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!