Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
    Bookmark Topic Watch Topic
  • New Topic

Iteration of List in JSP

 
M Zahid
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Report post to moderator
I got a List through criteria with following code. I am using struts and hibernate technologies in netBean6.8. The following method has been coded in a helper class.

public List appointmentSearch(String username, String date)
{
Session session=HibernateUtil.getSessionFactory().openSession();
Criteria criteria=session.createCriteria(Appointments.class);
criteria.add(Expression.eq("doctoruserid", username));
criteria.add(Expression.eq("appointmentdate", date));
List list=criteria.list();
return list;
}

============================================
Now I want to iterate the above list in jsp. Kindly guide for this or any other possible method to iterate this list.

 
Ram Narayan.M
Ranch Hand
Posts: 247
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Report post to moderator
JSTL Core tags can be used... "forEach" core tag can be used in jsp to process the List rather doing it in scriptlets...
 
Campbell Ritchie
Marshal
Posts: 52636
119
  • Mark post as helpful
  • send pies
  • Report post to moderator
I think this question would sit better on our JSP forum, so I shall move it.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65535
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please do not cross-post the same question in multiple forums. It wastes people's time when multiple redundant conversations take place. Please click this link ⇒ CarefullyChooseOneForum ⇐ for more information.
 
The moth suit and wings road is much more exciting than taxes. Or this tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!