tags:

views:

847

answers:

1

This is my action class

public Iterator<CgConsultant> getSearchresult() {

     List<CgConsultant> list =userSearch.getConsultantMatches(searchstring);
     System.out.println("The size of the resutl list:"+list.size());
     Iterator<CgConsultant> iterator = list.iterator();
     CgConsultant obj;
     while(iterator.hasNext()){
      obj = (CgConsultant)iterator.next();
      System.out.println(obj.getUsername());
      System.out.println(obj.getFirstName());
      System.out.println(obj.getLastName());
     }
     return iterator;
    }

And i have to populate the data in jsp and display it in the jsp

I m gettin the return status but how to populate the data n display it..

this is my jsp

<head>
    <title><fmt:message key="signup.title"/></title>
    <meta name="heading" content="<fmt:message key='signup.heading'/>"/>
</head>

<body>

     <h1> Search Complete</h1>
     <h2> Details are..</h2><br>

     <s:property value="Searchresult"/>

</body>
</html>

Please specify any suggestion..

A: 

Taglib c is http://java.sun.com/jsp/jstl/core

            <c:forEach items="${Searchresult}" var="cgConsultant">
                    <c:out value="${cgConsultant.username}"/>
                    <c:out value="${cgConsultant.firstName}"/>
                    <c:out value="${cgConsultant.lastNameName}"/>
            </c:forEach>

Add some nice html

krosenvold
yea.. m getting the index value of the array as the output.. java.util.AbstractList$Itr@1ddff76
Vinayak.B