struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Heiko Stoermer <heiko.stoer...@login-solutions.de>
Subject bug in nested?
Date Thu, 12 Sep 2002 08:46:48 GMT
Hi,

I've found a rather strange behaviour of the nested tag and I wonder if it's 
my fault or a bug.
I've a data-struture that looks like this:

[{'total': '2',
  'stati': [
             {'status': 100, 'count': '1'}, 
             {'status': 200, 'count': '1'}
           ]
 }, 
 {'total': '1', 
  'stati': [
             {'status': 100, 'count': '1'}
           ]
 }
]

A list of hashes where each element contains a list of hashes.
The above structure is saved in the form-bean 
as a property named data. When I iterate over this with nested:iterate in my 
jsp I get the error that stati[0] is a null value (which is not true):

                <nested:iterate property="data">
                        <tr>
                                <td><nested:write property="total"/></td>
                                <nested:iterate property="stati">
                                        <td>
                                        <nested:write property="count"/>
                                        </td>
                                </nested:iterate>
                        </tr>
                </nested:iterate>

However, the following works as expected:

                <nested:iterate property="data">
                        <tr>
                                <td><nested:write property="total"/></td>
                                <nested:iterate id="current" property="stati">
                                        <td>
                                        <bean:write name="current" 
property="count"/>
                                        </td>
                                </nested:iterate>
                        </tr>
                </nested:iterate>

I don't really understand this. Any help?

-- 
Dipl. Inf. (FH) Heiko Stoermer                               
Project Manager                                     Login & Solutions AG
heiko.stoermer@login-solutions.de          http://www.login-solutions.de


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


Mime
View raw message