code_junkie

Action and Jsp to get the iterator and display it

Nov 12th, 2011
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. public Iterator<CgConsultant> getSearchresult() {
  2.  
  3. List<CgConsultant> list =userSearch.getConsultantMatches(searchstring);
  4. System.out.println("The size of the resutl list:"+list.size());
  5. Iterator<CgConsultant> iterator = list.iterator();
  6. CgConsultant obj;
  7. while(iterator.hasNext()){
  8. obj = (CgConsultant)iterator.next();
  9. System.out.println(obj.getUsername());
  10. System.out.println(obj.getFirstName());
  11. System.out.println(obj.getLastName());
  12. }
  13. return iterator;
  14. }
  15.  
  16. <head>
  17. <title><fmt:message key="signup.title"/></title>
  18. <meta name="heading" content="<fmt:message key='signup.heading'/>"/>
  19. </head>
  20.  
  21. <body>
  22.  
  23. <h1> Search Complete</h1>
  24. <h2> Details are..</h2><br>
  25.  
  26. <s:property value="Searchresult"/>
  27.  
  28. </body>
  29. </html>
  30.  
  31. <c:forEach items="${Searchresult}" var="cgConsultant">
  32. <c:out value="${cgConsultant.username}"/>
  33. <c:out value="${cgConsultant.firstName}"/>
  34. <c:out value="${cgConsultant.lastNameName}"/>
  35. </c:forEach>
Add Comment
Please, Sign In to add comment