Can you pass an array to a bean

Hi, Can you pass an array to a bean?I need to pass 5 values to a bean if i convert the Bean setMethod to an array then I get an error thet the return type has to be an stringDoes anyone have an Idea how to do this ?TIADenis
[265 byte] By [JavaDen] at [2007-9-26 1:42:24]
# 1

If you use the <jsp:setProperty/> method you can do this.

If you give all 5 parameters the same name they will be passed as a String array.

In your bean have an appropriately named setMethod() that takes a String array and a String array member variable. The array will be populated with the five values.

rww96 at 2007-6-29 2:35:10 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
Hi,I wonder if U could send me an example of this (Sending array to bean). I have the same problem.Thanks in advance
sirHamid at 2007-6-29 2:35:10 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
Hiyou can pass everything to a bean :in your jsp make an instance of the bean , sayinstBean = new Bean();and then call the method :instBean.setArray(array);
florins1 at 2007-6-29 2:35:10 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...