sorry I did not clarify.

I was not advocating to do this in the jsp.
This should be done within the action.

I guess I take this for granted.....hmmm.

JM

> -----Original Message-----
> From: Damien VIEL [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, May 14, 2002 1:39 PM
> To: Struts Users Mailing List
> Subject: Re: Help : Dropdown List
>
>
> Ok,
> no problem with this example.
> But I've read that it's not a good choice to create the ArrayList
> in the JSP
> but create it
> in another class and put this Arraylist in the request object. So
> you set a
> bean in the JSP.
>
> <%jsp:UseBean......./%>
>     <td align="left">
>       <html:select property="type">
>         <html:options collection="serverTypes" property="value"
>                    labelProperty="label"/>
>       </html:select>
>     </td>
>
> My problem is that I do not know where and when I must add the
> ArrayList to
> the request object ?
>
> Dams
>
>
> ----- Original Message -----
> From: "James Mitchell" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Sent: Tuesday, May 14, 2002 7:20 PM
> Subject: RE: Help : Dropdown List
>
>
> > Well, if you look at the subscription.jsp.
> >
> >
> > The example loads these in the jsp, but this could easily have
> been a call
> > to your data manager/service or could even been pre-cached as an
> application
> > scope list.
> >
> >
> >
> > <%-- In real life, these would be loaded from a database --%>
> > <%
> >   java.util.ArrayList list = new java.util.ArrayList();
> >   list.add(new org.apache.struts.util.LabelValueBean("IMAP Protocol",
> > "imap"));
> >   list.add(new org.apache.struts.util.LabelValueBean("POP3 Protocol",
> > "pop3"));
> >   pageContext.setAttribute("serverTypes", list);
> > %>
> >
> >
> >
> >     <td align="left">
> >       <html:select property="type">
> >         <html:options collection="serverTypes" property="value"
> >                    labelProperty="label"/>
> >       </html:select>
> >     </td>
> >
> >
> > JM
> >
> > > -----Original Message-----
> > > From: Damien VIEL [mailto:[EMAIL PROTECTED]]
> > > Sent: Tuesday, May 14, 2002 1:11 PM
> > > To: Struts Users Mailing List
> > > Subject: Re: Help : Dropdown List
> > >
> > >
> > > Sorry no,
> > > but I'm going to :)
> > > Dams
> > > ----- Original Message -----
> > > From: "James Mitchell" <[EMAIL PROTECTED]>
> > > To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> > > Sent: Tuesday, May 14, 2002 6:59 PM
> > > Subject: RE: Help : Dropdown List
> > >
> > >
> > > > Did you get the struts-example running???
> > > >
> > > >
> > > > JM
> > > >
> > > > > -----Original Message-----
> > > > > From: Damien VIEL [mailto:[EMAIL PROTECTED]]
> > > > > Sent: Tuesday, May 14, 2002 12:54 PM
> > > > > To: Struts Users Mailing List
> > > > > Subject: Help : Dropdown List
> > > > >
> > > > >
> > > > > Hi :)
> > > > >
> > > > > Could anyone pls tell me how to populate a dropdown list using
> struts
> > > > >  tag libraries. I've heard that I need to put a Collection
> (Arraylist)
> > > in
> > > > > the request.
> > > > > This Collection is build from a Database.
> > > > > For Example I have 3 files :
> > > > > - UserForm.java
> > > > > - UserAction.java
> > > > > - SelectUser.jsp
> > > > >
> > > > > I want to select a user from the dropdown list that appears in my
> > > > > SelectUser.jsp file, in order to edit the user information
> > > for exemple.
> > > > >
> > > > > Thanks all
> > > > > Dams
> > > > >
> > > > >
> > > > >
> > > > > --
> > > > > 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