I am working on Struts2 application. In my jsp, I have a javascript variable whose value is being assigned through struts tag s:iterator.
Something like this:
//Javascript
// an object agent with getter setter which is being used through request.getParameter().
<script>
var user = new Array();
// i want to assign value to javascript array variable through this Agent object
<s:if test='agent!=null'>
<s:iterator var='i' value='agent'>
<s:if test='i!=null'>
user[user.length]= {
agentName:'<s:property value='agentName'/>',
agentId: '<s:property value='agentName'/>'
};
</s:if>
</s:iterator>
</s:if>
</script>
This javascript array will be used for the dropdown menu optiion in html, where when a person select an agent name, its relevent data will get populated in the next dropdown options.
But the user variable is not taking values through struts tag.
I am stuck on this. Any help?