Hi,

before wasting anybodies time, it was an error of mine.  I´m fairly new to
jsp and struts so errors like these happen.  I forgot a fairly important
include:

<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>

I won´t forget that one again :-).

Now I get the error "javax.servlet.ServletException: No getter method for
property entry_name of bean gbEntry"

I should be able solve it now though.

Thanks,

Michael


----- Original Message -----
From: "Michael Delamere" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Monday, May 20, 2002 1:06 PM
Subject: Re: Cannot find bean gbEntry in scope null


> HI,
>
> just another thought.  Should the the first two characters of the formBean
> name in the struts-config also be in lower-case?
>
> Here´s a snippet of my struts-config:
>
> ==============================================
> <struts-config>
>
>     <!-- ========== Form Bean Definitions  -->
>     <form-beans>
>        <form-bean  name="GBEntryForm"
> type="com.morelogs.guestbook.forms.GBEntryForm" />
>     </form-beans>
>     <!-- ========== Global Forward Definitions  -->
>     <global-forwards>
>         <forward name="gbForm"   path="/jsp/Welcome.jsp"/>
>         <forward name="error"   path="/jsp/Errorpage.jsp"/>
>     </global-forwards>
>
>   <action-mappings>
>     <action path="/saveGBEntry"
>             type="com.morelogs.guestbook.actions.SaveGBEntryAction"
>             name="GBEntryForm"  <!-- should the first two chars be in
> lower-case? -->
>             input="/jsp/welcome.jsp"
>             scope="session"
>             validate="true">
>        <forward name="success" path="/jsp/displayGBEntries.jsp" />
>    </action>
>   </action-mappings>
>
> </struts-config>
> ==================================================
>
> Thanks for your help,
>
> Michael
>
>
> ----- Original Message -----
> From: "Michael Delamere" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Sent: Monday, May 20, 2002 12:44 PM
> Subject: Re: Cannot find bean gbEntry in scope null
>
>
> > 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]>
> >
>
>
> --
> 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