Problem with retrieving a collection object from JSP
Hi Im using an action servlet to retrieve data from a database table, I save the data in to a collection and pass it using req.setAttribute. here's my code snippet:
timecardSQL timesql = new timecardSQL(con);
Collection col = timesql.findAll();
req.setAttribute(BeanNames.TIME_LIST, col);
return mapping.findForward("success");
I tried to retrieve the data through JSP using:
<logic:iterate name="timeList" id="columns" scope="request" type="webtm.database.timecard.timecardCOLS">
but it didn't work, JSP produced this error:
"Cannot find bean timeList in scope request" what does this mean? I can't understand it so I tried a different method, this time I used:
Collection col = (Collection) request.getAttribute("timeList");
if (col == null)
out.println("empty collection");
else
out.println("not empty");
Unfortunately, it prints out "empty collection",
why is the collection object not passed on to the JSP page?
Please help! Thanks!
Raymond

