Hi there,
Assuming that the "results" from your request.setAttribute() method in your action,
is the ArrayList returned from your getReservationInfo () method, then you should be
able to iterate without using the <bean:define> tag.
Try this for your iterate
<logic:iterate name="InfoBean" id="resinfobean">
<bean:write name="resinfobean" property="property_name" />
</logic:iterate>
where:
- InfoBean is the key you used to save the ArrayList to the request
- resinfobean is just a variable name that you will use to refer to each object of the
ArrayList and
- property_name is the property from the ReservationInfoBean that you are trying to
access.
This has worked for me
Brian
>>> [EMAIL PROTECTED] 11/20/01 06:22pm >>>
After a week of trying to get iterate to work...I give up. I tried
bean:define to see what that would do, and get the same error, so it must be
some context that I just don't get. So here I am, desperate and begging to
be put out of my misery!
In my JSP, either of these two lines that try to access the ArrayList from
the bean "InfoBean" from the property "reservationInfo".
<bean:define id="ReservationArrayList" name="InfoBean"
property="reservationInfo" type="java.util.ArrayList" scope="request" />
or
<logic:iterate name="InfoBean" property="reservationInfo"
id="reservationInfo" type="examples.ejb20.titan.common.ReservationInfoBean">
generate an error of:
CabinInfoBean: getReservationInfo called w/ 7 items in list
<Nov 20, 2001 6:19:14 PM EST> <Error> <HTTP>
<[WebAppServletContext(-5682806,titanstruts,/titanstruts)] Root cause of
ServletExeption
javax.servlet.jsp.JspException: Cannot find bean reservationInfo in scope
null
I've used InfoBean sucessfully for other simple types properties. Like the
following works fine:
<jsp:getProperty name="InfoBean" property="name"/>
The bean is of type CabinInfoBean, (excerpt minus constructor and other
properties)...
public class CabinInfoBean implements Serializable {
private ArrayList m_resInfoList = null; // List of
ReservationInfoBeans
public ArrayList getReservationInfo () {
log ("getReservationInfo called w/ " + m_resInfoList.size() + "
items in list");
return m_resInfoList;
}
}
My action sets CabinInfoBean...
request.setAttribute("InfoBean", results);
where results is a CabinInfoBean.
Suggestions? (45, 38 or 357?)
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>