aspose file tools*
The moose likes Struts and the fly likes getting an  EmpID  Name pair from a jsp into an ActionForm Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "getting an  EmpID  Name pair from a jsp into an ActionForm" Watch "getting an  EmpID  Name pair from a jsp into an ActionForm" New topic
Author

getting an EmpID Name pair from a jsp into an ActionForm

Pankaj Mulay
Greenhorn

Joined: Sep 07, 2006
Posts: 3
Hi all,

on my jsp I have an input where I select multiple employees using checkboxex
which are in the employee ID name structure.

Now I want to get both the emp ID and name fields on my ActionForm that to in the pairs as every emp id is associated with a specific name.

Can anyone Please tell me how to achieve that.

Thanks in advance.
waiting for reply.
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Create an "Employee" class as a JavaBean that has an ID and a name property, as well as any other information about an employee that you need. Then, create an "employees" property of your ActionForm bean that is an ArrayList of Employee objects. You can then manipulate and display these objects using "indexed properties". Here is a link that explains how to do this. This link explains some extra steps you must take if your AcitonForm is in request scope.


Merrill
Consultant, Sima Solutions
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: getting an EmpID Name pair from a jsp into an ActionForm