struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Johann Uhrmann <>
Subject List-backed properties
Date Thu, 06 Mar 2003 09:46:31 GMT
Hello all,

I am a little bit confused about an example for list-backed properties:

The documentation at
contains the following example in section 4.3.2:

public FooForm extends ActionForm {

     private final List values = new ArrayList();

     public void setValue(int key, Object value) {
         values.set(key, value);

     public Object getValue(int key) {
         return values.get(key);

As "values" is initialized as empty ArrayList, any call to values.set 
causes an IndexOutOfBoundException to be thrown.
(see also:,java.lang.Object)


Therefore, I cannot imagine how that example could ever work.
Could someone please explain me that discrepancy?

Thanks in advance,


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message