Amila Iddamalgoda
Amila Iddamalgoda

Reputation: 4286

How a loop works in struts application?

Hi I'm developing a struts 2 application and to the jsp im getting the list of objects. I want to do some thing like this using s tag library.I can get member name using get <s:property value="#member.name"/>

$(window).on('load', function () {


        <s:iterator value="members" var="member">
                    // GET MEMBER NAME & SEND TO POPULATE()
                populate(name);       
        </s:iterator> 


        });

        function populate(name){
            alert(name);                
        }

How can I send the #member.name of each member in members list to the populate function? Help me?

Upvotes: 1

Views: 83

Answers (1)

Roman C
Roman C

Reputation: 1

If you can get the property using property tag then you should pass it to the JS function as parameter. For example

populate('<s:property value="#member.name"/>');

Upvotes: 1

Related Questions