Your <logic:iterate> tag closes itself before it gets to the tag body.
i.e. <logic:iterate/>
I made this mistake a couple times too so don't feel bad!
 
On your bonus question, your JSP shouldn't be performing business logic,
the bean should be.  Create another getter on your bean for the specific
thing you want to display.  Alternatively, inside your <logic:iterate>
you could wrap a <logic:equal> tag around your <bean:write> and
conditionally display a particular value within the iteration.
 
Roman

         
        -----Original Message----- 
        From: Alex Colic 
        Sent: Thu 4/19/2001 12:50 PM 
        To: Struts 
        Cc: 
        Subject: Need help with logic:iterate :)
        
        

        Hi,
        
        I am trying to get a handle on the logic:iterate tag.
        
        I have an object in application scope under the key
'storeroomList.'
        There is a vector of objects under the property 'storeroomList'.
Each one of
        the objects in this vector has a property 'name.'
        
        What I am trying to do is go through the vector and print out
the names. I
        have attempted the below but the only storeroom name to be
printed out to
        the screen is the last storeroom. I traced the execution of the
iterate
        class and it looks to be getting the correct data, going through
each
        element of the vector and pulling out the name property and then
looping
        through all the elements without printing them to the screen and
then the
        bean:write is called.
        
        Any help is as usual greatly appreciated.
        
        
        Oh, bonus question.. Lets say I only wanted to print out a
particular
        storeroom. Iterate through the vector but only print the
storeroom that had
        the name "main."
        
        
        <logic:iterate id="storerooms" name="storeroomList"
scope="application"
        property="storeroomList"/>
                <bean:write name="storerooms" property="name" /><BR>
        </logic:iterate>
        
        
        Regards
        
        Alex
        
        

winmail.dat

Reply via email to