Hi,

thanks for the response.

Yes, it�s definitely returning an array.  I�ll paste some code for you to
look at.

============= In ActionServlet calling SessionBean ===========
         // Get a naming context
         InitialContext jndiContext = new InitialContext();

         // Get a reference to gbEntries Bean
         Object ref  = jndiContext.lookup("ejb/guestbook/gbEntries");

         // Get a reference from this to the Bean's Home interface
         gbEntriesHome home = (gbEntriesHome)
            PortableRemoteObject.narrow (ref, gbEntriesHome.class);

    ArrayList entryList = new ArrayList();
    gbEntries entriesObj = home.create();
    Object[] entries = entriesObj.getEntriesList();
    for (int i = 0; i < entries.length; i++)
    {
     gbEntry entry = (gbEntry) entries[i];
      entryList.add(entry);

      System.out.println (entry.getEntry_subject() + "\t" +
entry.getEntry_text() + "\t" +
         entry.getEntry_date() + "\t" + entry.getEntry_views());
    }
    entryForm.setEntryList(entryList);  // Assigning my ArrayList to my
formBean which has session scope
=============================================================

==== My getter and setter methods for the ArrayList in my FormBean
=============
  public void setEntryList(ArrayList _entryList) {
   this.entryList = _entryList;
  }
  public ArrayList getEntryList() {
   return this.entryList;
==============================================================

The error message says something about "scope null".  What does that mean?
The scope should be session shouldn�t it?

Thanks for your help,

Michael



----- Original Message -----
From: "Adam Hardy" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Monday, May 20, 2002 9:54 AM
Subject: Re: Cannot find bean gbEntry in scope null


> Hi Michael,
>
> first thing I see is that you are using the class name syntax for the
> iterate tag (GBEntryForm) instead of the instance name syntax
> (gbEntryForm). Secondly, I'm sure I read a post recently that said there
> was some sort of bug with instance names that began with 2 capital
> letters - I can't remember precisely so it might be irrelevant, but I
> generally whole words or at least syllables rather than letters like that.
>
> Having said that, your error msg is about gbEntry, not gbEntryForm, so
> it probably doesn't make any difference.
>
> Are you sure entryList() is returning the array?
>
> Adam
>
> Michael Delamere wrote:
>
> >Hi,
> >
> >I think I�ve set up the iterate tag correctly now:
> >
> ><logic:iterate name="GBEntryForm"                 <!-- name of form
bean -->
> >           id="gbEntry"                                         <!-- name
of
> >entity bean -->
> >           scope="session"                                    <!--
session
> >scope -->
> >           property="entryList"                              <!-- name of
> >ArrayList -->
> >           type="com.morelogs.guestbook.interfaces.gbEntry">
> >
> >  <bean:write name="gbEntry" property="entry_subject" /><br />
> >  <bean:write name="gbEntry" property="entry_name" /><br />
> >  <bean:write name="gbEntry" property="entry_date" /><br />
> ></logic:iterate>
> >
> >I�m sure that the above is correct.
> >
> >What could be the reasons for getting the error stated in the subject
line?
> >
> >Thanks,
> >
> >Michael
> >
> >
> >----- Original Message -----
> >From: "Michael Delamere" <[EMAIL PROTECTED]>
> >To: "'Struts Users Mailing List' (E-mail)"
<[EMAIL PROTECTED]>
> >Sent: Sunday, May 19, 2002 9:58 PM
> >Subject: Cannot find bean gbEntry in scope null
> >
> >
> >
> >
> >>Hi,
> >>
> >>Sorry to bring this up again, but I still don�t fully understand how to
> >>iterate through my ArrayList.  I get the error "Cannot find bean gbEntry
> >>
> >>
> >in
> >
> >
> >>scope null" when I try to iterate through my list of objects.
> >>
> >>In my ActionServlet I communicate with my ejb session-bean in order to
get
> >>
> >>
> >a
> >
> >
> >>list of guestbook entries.  Once I have received the data I add my
gbEntry
> >>entity-beans into an ArrayList using a function in my formBean:
> >>
> >>  public void setEntryList(ArrayList _entryList) {
> >>   this.entryList = _entryList;
> >>  }
> >>
> >>My formBean has session scope:
> >>
> >>    <action path="/saveGBEntry"
> >>            type="com.morelogs.guestbook.actions.SaveGBEntryAction"
> >>            name="GBEntryForm"
> >>            input="/jsp/welcome.jsp"
> >>            scope="session"
> >>            validate="true">
> >>       <forward name="success" path="/jsp/displayGBEntries.jsp" />
> >>   </action>
> >>
> >>When my formBean has session scope as stated in the config, does this
mean
> >>that my formBean no longer has to be assigned to the session?
> >>================================================================
> >>As suggested to me I used this in my *.jsp file in order to get at the
> >>
> >>
> >list
> >
> >
> >>of objects.
> >>
> >><!-- where is the _EntryList_ supposed to be mentioned? -->
> >><logic:iterate name="GBEntryForm"
> >>            id="gbEntry"
> >>            scope="session"
> >>         property="gbEntry"
> >>            type="com.morelogs.guestbook.interfaces.gbEntry">
> >>
> >>  <bean:write name="gbEntry" property="entry_subject" /><br />
> >>  <bean:write name="gbEntry" property="entry_name" /><br />
> >>  <bean:write name="gbEntry" property="entry_date" /><br />
> >></logic:iterate>
> >>=================================================================
> >>I�ve read the documentation but I�m still not fully clear about where to
> >>state
> >>
> >>1) GBEntryForm (containing the EntryList)
> >>2) EntryList (containing the GBEntry objects)
> >>3) GBEntry (object containing the data)
> >>
> >>in order to iterate through the list.
> >>
> >>Any help would be much appreciated!
> >>
> >>Thanks,
> >>
> >>Michael
> >>
> >>
> >>--
> >>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]>
> >
> >
> >
> >
>
>
>
> --
> 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