Mike Elliott wrote the following on 7/18/2005 3:18 PM:

I came up with another solution which might be worthy of
consideration.  Instead of using arrays, extend a list with the
desired get( int ) method and use that list instead:

 public class SkillActionForm extends ActionForm {

      protected List skills = new LazyArrayList();

      public class LazyArrayList extends ArrayList {
         public Object get( int index ) {
            while (size() <= index) add( new SkillBean()  );
            return super.get( index );
         }
      }
  }

This is the solution I eventually adopted (successfully) but I have a
fondness for nested classes which others may not share.

I'm pretty sure what LazyList is doing similar stuff in the background, so I'm curious why you don't just use that?

http://wiki.apache.org/struts/StrutsCatalogLazyList

--
Rick

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to