Posted By:
Raymond_Wee
Posted On:
Monday, March 18, 2002 11:20 PM
Hi! I have a problem with regards to passing a collection object from an action servlet to a jsp using struts. In my perform function I passed a collection object using setAttribute. Here's a code snippet of my perform function: timecardSQL timesql = new timecardSQL(con); Collection col = timesql.findAll(); System.out.println(BeanNames.TIME_LIST); req.setAttribute("timeList", col); return mapping.findForward("success"); for my jsp page, I tried to retrieve it using it produced a "cannot find bean timeList on scope request" error. Why is that? I can't figure it out so I tried using jsp code <%
More>>
Hi!
I have a problem with regards to passing a collection object from an action servlet to a jsp using struts.
In my perform function I passed a collection object using setAttribute.
Here's a code snippet of my perform function:
timecardSQL timesql = new timecardSQL(con);
Collection col = timesql.findAll();
System.out.println(BeanNames.TIME_LIST);
req.setAttribute("timeList", col);
return mapping.findForward("success");
for my jsp page, I tried to retrieve it using
it produced a "cannot find bean timeList on scope request" error. Why is that?
I can't figure it out so I tried using jsp code
<%
Collection col = (Collection) request.getAttribute("timeList");
if (col == null)
out.println("null");
else
out.println("not null");
%>
this time I get a attribute has no value error.
Please help, thanks!
Raymond