This may be a little far out there, but I notice that the id that you are
using for your iterate is the same as the property name.  Try changing the
id parameter to something like, app.  For example

<logic:iterate name="InfoBean" property="reservationInfo"
id="app" type="examples.ejb20.titan.common.ReservationInfoBean">

<bean:write name="app">

</logic:iterate>

Also note that InfoBean.getReservationInfo needs to return a collection,
arraylist, or map that contains the elements of
type=examples.ejb20.titan.common.ReservationInfoBean.
If this is not the case, there will be a class cast problem.

--
If this isn't the problem, start with a smaller with trying to use iterate.
Just create an array list and put it in the session, and then try to
iterate.

<logic:iterate id="app" name="yourArrayListSession" type="<whatever type of
element is in your array list>">

<bean:write name="app">

</logic:iterate>

Hope this helps

-----Original Message-----
From: Jeff Allen [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, November 20, 2001 4:23 PM
To: [EMAIL PROTECTED]
Subject: Cannot find bean xyz in scope null


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]>

Reply via email to