Ok... got that now!. The standard struts way of doing this would be...
<logic:iterate id="foos" name="foo_array">
<bean:define id="fooBar" property="bar" name="foos"/>
<logic:greaterThan name="fooBar" property="test" value="1000">
//do something
</logic:greaterThan>
</logic:iterate>
(somehow that was not working in the example I tried to make sure before I
send the solution. now it works!!!)
HTH
Nitesh
----- Original Message -----
From: "Nitesh" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <user@struts.apache.org>
Sent: Wednesday, June 22, 2005 11:31 AM
Subject: Re: Accessing nested properties
Guess this is not standard way of doing it...
kinda wicked way... try this... might work
<logic:iterate id="foos" name="foo_array">
<% pageContext.setAttribute("fooBar",foos.getBar()); %>
<logic:greaterThan name="fooBar" property="test" value="1000">
//do something
</logic:greaterThan>
</logic:iterate>
HTH
Nitesh
> Fredrik Bostrom wrote:
>
>> Hi list,
>>
>> How do I access a nested property in an iterated object?
>>
>> I've got two classes like this (heavily simplified and stripped):
>>
>> class Foo {
>> Bar bar = new Bar();
>> }
>>
>> class Bar {
>> int test = 10; //any value
>> }
>>
>> In my jsp-page, I'm iterating an array of foo-objects and I want to
>> access the test-field in the Bar-class from within the iteration. How
>> do I do that?
>>
>> This is what I'd like to do:
>>
>> <logic:iterate id="foos" name="foo_array">
>> <logic:greaterThan name="foos" property="bar.test" value="1000">
>> //do something
>> </logic:greaterThan>
>> </logic:iterate>
>>
>> But this doesn't work... Any ideas?
>>
>>
>> Regards,
>> Fredrik Boström
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
--
Fredrik Boström
+358 44 306 1324
[EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]