tags:

views:

327

answers:

1

I'm pretty sure this isn't possible but I figured it wouldn't hurt to ask....

I have a jsp that tries to get an array from it's java action class. however that array is in a list...

So I'm wondering if I can pass a parameter to my getter function to return a specific array from my list.

Such as

<s:iterator value="List.arrayName">
    <s:property/>
</s:iterator>

and then my getter would be something like

getList(String arrayName)
{
    return List.get(List.indexOf(arrayName));
}

ugh... it's too early... Thanks for any insight you can give or you can just rip me apart for my lack of coding skill... whichever works best for you.

A: 

You may be able to access the specific index of the List directly.

  <s:iterator value="MyList[#index]">

Which gets the #index of MyList which in your case is an array. You can nest this inside another iterator if you want to get each array from the list.

Vincent Ramdhanie
hmm... I'd still have to write a getter to find the index though, so I don't think this is what I'm really looking for.
Shaded