Question

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?

Was it helpful?

Solution

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"/>');
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top