hihi,

i have a jsp with the following:

<c:forEach var="i" begin="0" end="5">
<html-el:text name="MyObj" property="foo[${i}].bar"/>
</c:forEach>

in MyObj i have these methods:

public Collection getFoo() {
  return foo;
}

public Bar getFoo(int i) {
  while(i >= foo.size()) {
    ((ArrayList)foo).add(new Bar());
  }
  return (Bar)((ArrayList)foo).get(i);
}

when i request for the jsp, it calls the first getFoo() method.  should
it not call the second getFoo(int) method instead, since the jsp is
using jstl to provide an index parameter?

the weird part is when i take out the getFoo() method and recompile,
then the jsp calls getFoo(int) correctly.

why is the behavior like this?  is this a bug?

(when it calls the first getFoo() method i get an indexOutOfBounds
exception because my foo collection has nothing in it... i want the
collection size to be driven by the jsp page)

thanks in advance,
woodchuck


                
__________________________________
Do you Yahoo!?
Y! Messenger - Communicate in real time. Download now. 
http://messenger.yahoo.com

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

Reply via email to