If you're putting your mitarbeiterListe in the session you don't need to
instantiate your bean in the page (i.e. <bean:define etc).
If you want to put it in the session do this in your action class.
session.setAttribute("mylist",mylist);
Or in the request depending on what you want...
Then get your list out of the session like you're doing.. You don't need to
worry aboy the <bean:define stuff unless your looking to get at a list or
something without making available in the request or session or something..
<html:options collection="mitarbeiterListe" property="id"
labelProperty="name" />
Hope this helps. mark
On 22-12-2002 15:08, "Tobias Flohre" <[EMAIL PROTECTED]> wrote:
> Hello everybody,
>
> I have a serious problem, I already looked up all the list but didn't get
> any information helping me to solve it. I am new to struts, so maybe it is
> a simple thing, please take a look!
>
> I have an action mitarbeiterAuswahlShow filling a form bean
> MitarbeiterAuswahlForm, here the parts of the struts-config.xml:
>
> <form-bean name="mitarbeiterAuswahlForm"
> type="de.adesso.aproda.forms.MitarbeiterAuswahlForm"/>
>
> <action path="/mitarbeiterauswahlShow"
> type="de.adesso.aproda.actions.MitarbeiterauswahlShowAction"
> name="mitarbeiterAuswahlForm"
> scope="session"
> parameter="method">
> <forward name="show" path="/mitarbeiterauswahl.jsp"/>
> </action>
>
> When the action is called, the code is processed (i have some
> system.out.println in the action class, it looks good there). The server
> tells me this:
>
> 2002-12-22 02:37:13 - path="" :action: Storing instance under attribute
> 'mitarbeiterAuswahlForm' in scope 'session'
>
> which sounds pretty good to me, too.
> But when I want to access mitarbeiterauswahlForm in the jsp, I get this:
>
> javax.servlet.ServletException: Cannot find bean mitarbeiterAuswahlForm in
> scope session
>
> What are possible reasons for this??
>
>
> For further information I add some snippets from the action class and the
> jsp:
>
> MitarbeiterAuswahlForm mitarbeiterAuswahlForm
> = (MitarbeiterAuswahlForm)form;
> ...
> mitarbeiterAuswahlForm.setMitarbeiter (mitarbeiter);
> mitarbeiterAuswahlForm.setStudenten (studenten);
> return mapping.findForward("show");
>
> I added this line:
> request.setAttribute("mitarbeiterAuswahlForm",mitarbeiterAuswahlForm);
> in the action class, but it is not necessary to do this by myself, right?
> struts should put in the scope, no?
>
> and the jsp:
> <bean:define id="mitarbeiterListe" name="mitarbeiterAuswahlForm" property
> ="mitarbeiter"/>
> <html:select styleClass="textbox" size="1" tabindex="3" property
> ="mitarbeiterID">
> <html:options collection="mitarbeiterListe" property="id" labelProperty
> ="name" />
> </html:select>
>
>
>
> Thanks for any help!!!
>
> Tobias
>
>
>
> --
> 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]>