struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nitish Kumar <nitish.ku...@tavant.com>
Subject RE: Populating growing List
Date Mon, 23 May 2005 12:13:53 GMT

dont think its a great idea, If I start putting beans in session , every
time I have a collection in form bean, I am not sure how long my application
is going to run.



Thanks and Regards,
Nitish Kumar


-----Original Message-----
From: Nils Liebelt [mailto:nils@candor.co.za]
Sent: Monday, May 23, 2005 5:39 PM
To: 'Struts Users Mailing List'
Subject: RE: Populating growing List


What a bummer. I got the wrong scope!?! If I put the Form in session scope
it works fine. Gonna borrow a tie from my boss so I can hang myself... 


Cheers,

Nils

-----Original Message-----
From: Nils Liebelt [mailto:nils@candor.co.za] 
Sent: Monday, May 23, 2005 1:50 PM
To: 'Struts Users Mailing List'
Cc: mike@candor.com
Subject: Populating growing List

Hi all,

I know that common issue with indexed properties as mentioned in the wiki
http://wiki.apache.org/struts/StrutsCatalogLazyList.

So I wrote a little handcranked lazy list but I still get an
indexoutofbounce exception. I really don't know whats going on here: 

    private ArrayList deleteSelection = new ArrayList();
    
    public void setDeleteSelection(int i, String toDelete) {
	this.deleteSelection.set(i, toDelete);
    }

    public String getDeleteSelection(int i) {
        while(i>=this.deleteSelection.size()) {
            this.deleteSelection.add(new String(""));
        }
        return (String) this.deleteSelection.get(i);

    }

The nested exception looks like this:

Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
        at java.util.ArrayList.RangeCheck(ArrayList.java:508)
        at java.util.ArrayList.set(ArrayList.java:336)
at
com.candor.hummingbird.forms.AccountForm.setDeleteSelection(AccountForm.java
:74)



Regards,

Nils


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message