You can call it a "subclass", or you can say it "implements" something. It's the same thing. I believe that you'll get into trouble if you try to make a class which is both a bean AND a collection. You'll end up having to make a bean which contains a collection property AND a size property. I'm not sure exactly how this is going to interact with the form population process.
> -----Original Message----- > From: David Graham [mailto:[EMAIL PROTECTED]] > > My custom Collection class is not a subclass of anything. It > implements the > Collection interface and adds a getSize() method so the EL > will work . This > solution works. > > What I really need to know is if Struts can populate a > Collection class > instead of a String[] for arrays of fields. It acts like it > can't but I may > be missing something. > > I think the problem is that the EL requires my custom > Collection and struts > requires a String[]. > > Thanks, > David > > > > > > > >From: "Karr, David" <[EMAIL PROTECTED]> > >Reply-To: "Struts Users Mailing List" > <[EMAIL PROTECTED]> > >To: "Struts Users Mailing List" <[EMAIL PROTECTED]> > >Subject: RE: How does Struts handle arrays of fields? > >Date: Wed, 4 Dec 2002 11:37:38 -0800 > > > >If I'm seeing your problem correctly, you probably know by > now that the > >EL only references bean properties, except when it's referencing > >collections :) . It checks whether something is a > collection before it > >checks whether it is a bean, so creating a SUBCLASS of a collection > >class and adding bean properties won't work. You'll have to > have a bean > >class that has a collection property, AND a size property. Try > >restructuring your bean to deal with that and see how far you get. > > > > > -----Original Message----- > > > From: David Graham [mailto:[EMAIL PROTECTED]] > > > > > > I have a set of hidden fields all named "deletedId" but with > > > different > > > values. What type should this be in my ActionForm? It works > > > if I have > > > private String[] deletedId; and related accessor methods. > > > > > > My problem is that I want to use the JSTL's EL to get the > > > size of this > > > array. I tried ${myForm.deletedId.length} with no success so > > > I tried using > > > a custom Collection class with a getSize() method and > > > ${myForm.deletedId.size}. So I have a > > > public Collection getDeletedId() and a > > > public void setDeletedId(String[] id) method. Struts > > > apparently didn't like > > > that I was trying to trick it and doesn't refill the array > > > when there's an > > > error on the form. > > > > > > Any suggestions? > > > > > > Thanks, > > > Dave > > > > > > _________________________________________________________________ > > > Add photos to your messages with MSN 8. Get 2 months FREE*. > > > http://join.msn.com/?page=features/featuredemail > > > > > > > > > -- > > > 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]> > > > _________________________________________________________________ > The new MSN 8: advanced junk mail protection and 2 months FREE* > http://join.msn.com/?page=features/junkmail > > > -- > 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]>