wood burning stoves 2.0*
The moose likes JSP and the fly likes Iteration of List in JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSP
Reply locked New topic

Iteration of List in JSP

M Zahid

Joined: Feb 05, 2011
Posts: 3
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

Joined: Jul 11, 2010
Posts: 247

JSTL Core tags can be used... "forEach" core tag can be used in jsp to process the List rather doing it in scriptlets...

SCJP 6 [SCJP - Old is Gold]
Campbell Ritchie

Joined: Oct 13, 2005
Posts: 36453
I think this question would sit better on our JSP forum, so I shall move it.
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 60046

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.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Don't get me started about those stupid light bulbs.
subject: Iteration of List in JSP
Similar Threads
Caseinsensitive Search Hibernate API
SQL to HSQL - DetachedCriteria
Iteration of List in JSP
AND/OR in Hibernate - Criteria object
Hibernate returns duplicate results