Announcement Announcement Module
Collapse
No announcement yet.
invoking bean method with variable number of arguments Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • invoking bean method with variable number of arguments

    Hi,

    I'm trying to invoke a bean method with a variable number of arguments (as in "doSth(obj1, obj2)") and figured out that what I need to to is to create a new array with my objects to pass into the "doSth" method. However, I can't seem to get the syntax right for an OGNL expression that would produce this. I have tried

    method="doSth(${new Object[] {obj1, obj2}})"

    but for some reason I get a

    java.lang.ClassNotFoundException: ${new

    no idea why this happens. If I define a method "doSth" with two parameters of type Object and call it like this

    method="doSth(${obj1},${obj2}"

    then things work fine. Any ideas, anyone?

    Cheers,

    Alex
Working...
X