Hey Roland,

        I'm not sure but I wonder if u can "fool" struts into doing this
with the new Struts-EL.
I wonder if u do something like assuming that ur singleton is class Blah
and it defines a static method called getInstance() [since its a singleton
it should]
then u should be able to make do.
        ${blah.instance.allParts} in EL. no? i'm pretty new to the whole EL
thing still so I'm not 100% sure. Shawn Bayern or David Karr or David Graham
(who contributed Struts-EL) might better answer that :-P
        if that does work but u cant use Struts-EL you can still set up a
var using c:set.

-Tim

-----Original Message-----
From: Roland Carlsson [mailto:roland.c@;swetravel.se]
Sent: Thursday, October 24, 2002 8:12 AM
To: Struts Users Mailing List
Subject: Re: <html:options />


I found whats wrong... my bean aren't a bean... since a bean have to have a
public no argument constructor and my is a Singleton... so I'll guess that I
have to live with a little ugliness in the view.

<%
  request.setAttribute("parts",
demo.DBApplication.getInstance().getAllParts());
%>

Thanks for the fun and the help

Regards
Roland

----- Original Message -----
From: "deepak" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, October 24, 2002 1:51 PM
Subject: Re: <html:options />


> Yes you can.
>
> for e.g.
>
> <bean:define id="carriers" name="CarrierForm" property="carrierVector"/>
>
> ----- Original Message -----
> From: "Roland Carlsson" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Sent: Thursday, October 24, 2002 5:04 PM
> Subject: Re: <html:options />
>
>
> > Can't carriers be a collection that I can get from the ActionForm?
> >
> > Regards
> > Roland Carlsson
> >
> > ----- Original Message -----
> > From: <[EMAIL PROTECTED]>
> > To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> > Sent: Thursday, October 24, 2002 1:11 PM
> > Subject: Re: <html:options />
> >
> >
> > >
> > > <html:select property="carrier" > <%-- The form's property to be
> > > populated --%>
> > >       <html:options collection="carriers" property="id" labelProperty
> > > ="name"/>
> > > </html:select>
> > >
> > > carriers is a list of Carrier objects in my Session Context
> > >
> > >
> > >
> > >
> > >
> > >                       "Roland
> > >                       Carlsson"                To:      "Struts Users
> > Mailing List" <[EMAIL PROTECTED]>
> > >                       <roland.c@swetra         cc:
> > >                       vel.se>                  Subject: <html:options
/>
> > >
> > >                       24/10/2002 01:04
> > >                       PM
> > >                       Please respond
> > >                       to "Struts Users
> > >                       Mailing List"
> >
> > >
> > >
> > >
> > >
> > >
> > >
> > > Hello!
> > > I'm trying to use <html:options/> but the only thing I get get into
> > > the list
> > > are Object.toString() values witch is not very useful for the user.
> > >
> > > What I like to do is the equal to
> > >
> > > <option value="<%= myObj.getId() %>"><%= myObj.getName() %></option>
> > >
> > > Can this be done?
> > >
> > > Thanks in advance
> > > Roland Carlsson
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:   <
> > > mailto:struts-user-unsubscribe@;jakarta.apache.org>
> > > For additional commands, e-mail: <
> > > mailto:struts-user-help@;jakarta.apache.org>
> > >
> > >
> > >
> > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> > <mailto:struts-user-unsubscribe@;jakarta.apache.org>
> > > For additional commands, e-mail:
> > <mailto:struts-user-help@;jakarta.apache.org>
> > >
> >
> >
> > --
> > To unsubscribe, e-mail:
> <mailto:struts-user-unsubscribe@;jakarta.apache.org>
> > For additional commands, e-mail:
> <mailto:struts-user-help@;jakarta.apache.org>
>
>
> --
> To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@;jakarta.apache.org>
> For additional commands, e-mail:
<mailto:struts-user-help@;jakarta.apache.org>
>


--
To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail:
<mailto:struts-user-help@;jakarta.apache.org>

--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@;jakarta.apache.org>

Reply via email to