Struts: Accessing a single element of a list in my scope.

  • Thread starter Thomas 'Skip' Hollowell
  • Start date
T

Thomas 'Skip' Hollowell

I can iterate over the memebers of my list, and do what needs to be done
on my page. But how do I, if I want to, access just a specific member
of my list? I really have tried searching for what should be a simple
thing, but when you are searching on 'index' and 'list', well you don't
tend to get very valuable results.

Any help?

Skip Hollowell
 
F

FD

Thomas 'Skip' Hollowell said:
I can iterate over the memebers of my list, and do what needs to be done
on my page. But how do I, if I want to, access just a specific member
of my list? I really have tried searching for what should be a simple
thing, but when you are searching on 'index' and 'list', well you don't
tend to get very valuable results.

Any help?

Maybe you can do this :
iterate over the collection and defining an index
test if index is value you search
if ok, print the value
else do nothing

With taglibs :

<logic:iterate name="myList" id="myElement" type="TypeOfMyElement"
indexId="index">
<logic:equal name="index" value="searchedValue">
Searched element is : <bean:write name="meElement"/>
</logic:equal>
Skip Hollowell
FD
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top