struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fredrik Boström <fredrik.bost...@helsinki.fi>
Subject Re: Accessing nested properties
Date Tue, 21 Jun 2005 21:18:14 GMT
Thanks, but I couldn't wait any longer for a solution, so I rewrote the 
whole page with jstl instead. Works like a charm :)


Regards,
   Fredrik



rajiv verma wrote:
> Try adding the "type" attribute  to the logic:iterate tag.
> I always do something like this:
> <logic:iterate name="adminAuthCompany" id="adminAuthCompanyId"
> type="com.ao.model.auth.IAuthorizationParameter">
> and it works for me.
> -Rajiv
> 
> 
> On 6/21/05, Fredrik Boström <fredrik.bostrom@helsinki.fi> wrote:
> 
>>No, the foo_array is an array of Foo. Each Foo object holds a Bar object
>>wich holds a test field (see sample code). I'm trying to access the
>>test-field's value from within the iteration over Foo objects.
>>
>>Regards,
>>  Fredrik
>>
>>
>>Laurie Harper wrote:
>>
>>>Change property="bar.test" to property="test"; assuming foos_array is an
>>>array of Bar then, within the iterate tag body, 'foos' is bound to an
>>>instance of Bar on each iteration.
>>>
>>>L.
>>>
>>>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: user-unsubscribe@struts.apache.org
>>>For additional commands, e-mail: user-help@struts.apache.org
>>>
>>
>>--
>>Fredrik Boström
>>+358 44 306 1324
>>fredrik@fredrikbostrom.net
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>For additional commands, e-mail: user-help@struts.apache.org
>>
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 

-- 
Fredrik Boström
+358 44 306 1324
fredrik@fredrikbostrom.net

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message