This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Struts and the fly likes get list value using index in logic : iterate Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "get list value using index in logic : iterate" Watch "get list value using index in logic : iterate" New topic
Author

get list value using index in logic : iterate

Shilpa Tendulkar
Ranch Hand

Joined: Jul 29, 2001
Posts: 75
Hi

I have a list (allChannels) with channelIds and name(say about 50) and another list(zoneChannels) which contains few channelIds only(say about 5).
What I am expecting here is, when I iterate allChannels list, I want to set the index from zoneChannels Ids to allChannels list and get the value directly. like in java you can say list.get(1) will return the element.

What I have tried here is



Can anyone help me with how to achive this using struts tag please?


SCJP5
Shilpa Tendulkar
Ranch Hand

Joined: Jul 29, 2001
Posts: 75
I am almost there I used logic : match



problem with this is how do i set the value as a "zoneChannelID" to <logic : match >

Please help...
Shilpa Tendulkar
Ranch Hand

Joined: Jul 29, 2001
Posts: 75
I finally resolved this. I found you can not nest <bean : write > with logic tags

So what I have done is, I used <logic : equal > and get the zoneChannelID variable in java and use it in logic

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: get list value using index in logic : iterate
 
Similar Threads
not able to display arrayList properly using html:select
Indexed Properties with List of Strings
how to break logic : iterate on condition
Iterate List on jsp (struts)
html:checkbox element with POJO-based array not updated