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

Discussion in 'Java' started by Thomas 'Skip' Hollowell, May 11, 2004.

  1. 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
    Thomas 'Skip' Hollowell, May 11, 2004
    #1
    1. Advertising

  2. Thomas 'Skip' Hollowell

    FD Guest

    "Thomas 'Skip' Hollowell" <> wrote in
    message news:...
    > 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>
    </logic:iterate>

    > Skip Hollowell

    FD
    FD, May 11, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Paul Opal
    Replies:
    12
    Views:
    927
    Paul Opal
    Oct 11, 2004
  2. ann
    Replies:
    13
    Views:
    648
    Patricia Shanahan
    Sep 13, 2005
  3. Replies:
    11
    Views:
    582
    Paul McGuire
    Jun 29, 2005
  4. HANM
    Replies:
    2
    Views:
    695
    Joseph Kesselman
    Jan 29, 2008
  5. Christopher Benson-Manica

    Element in a td accessing parent <tr> element

    Christopher Benson-Manica, Mar 30, 2005, in forum: Javascript
    Replies:
    3
    Views:
    128
    Christopher Benson-Manica
    Mar 30, 2005
Loading...

Share This Page