Domanda

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?

È stato utile?

Soluzione

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"/>');
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top