First of all, all of your seach methods are wrong. In every case, you only create one instance of the MemberInfo bean. Then, in your loop as you read through the result set, you're replacing the data in
the same instace of the bean rather than creating a new instance for every row. Then you put that same instance into the array list. You end up having a liast of say, 10 rows, each of which is pointing to the same instance of MemberInfo, which has data for the last row in the ResultSet.
To solve this, move this line:
MemberInfo memberinfo= new MemberInfo();
from its current location to right after:
while(rs.next())
{
Do this in each of your search methods.
You also have a problem in your Action.
Remove the following statement from SearchMemberHNTeamProfileAction:
request.setAttribute("MemberInfo",memberinfo);
It's creating a neame conflict. In your <logic:iterate> tag in the
JSP, you are also using a bean name of memberinfo. Here's what you're telling
Struts to do when you write this tag:
<logic:iterate id="memberinfo" name="Member" scope="request">
Loop through every element of the ArrayList identified by the name "Member" in request scope. For each item in the array, create a bean with the name "memberinfo" that represents the current item in the loop. Any statements below this can use the name "memberinfo" to identify that bean.
[ July 24, 2006: Message edited by: Merrill Higginson ]