This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Struts and the fly likes Struts2 problem with if tag inside iterator Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts2 problem with if tag inside iterator" Watch "Struts2 problem with if tag inside iterator" New topic
Author

Struts2 problem with if tag inside iterator

Joe Tito
Greenhorn

Joined: May 03, 2011
Posts: 1

I'm having problems trying to get an if statement to work inside of an iterator tag and i can't seem to figure it out.

addressTypeList is an array list of AddressType that has a boolean value 'selected' that will be true/false depending on if that current address is selected. I can't seem to figure out the proper syntax so that if statement evaluates as true.

Here is my iterator code.



Here is my action class, I believe I have the right getter methods provided. AddressInformationBean contains the addressTypeList List i'm iterating through.



Here is my AddressType class:

Robin John
Ranch Hand

Joined: Sep 10, 2008
Posts: 270

did you find out the soulution ?

what are you trying to achieve ? if you just want to retain the value that the user has already selected then its not the write way, you can retain the selected value by setting the value in the property tag using OGNL.

and if you haven't already noticed, your code tags dont start and end correctly, you have some extra "<" in line2 and extra </value> tags there.... they might be causing some problems.

let me know if you need help.


Time is what we want the most, but what we use the worst. -- William Penn
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts2 problem with if tag inside iterator