I retrieve my String from Struts using the following
$(document).ready(function( data )
{
$('#contextsTextArea').val('<s:property value="myMessage"/>')
});
and it displays fine.
If my struts action returns a List of string instead how do I iterate through this list using JQuery?
This is my attempt but it does not display anything, Any idea what is wrong?
$('<s:property value="myMessage"/>').each(function (key, value) {
alert(value);
});
I believe best way to do this is to use struts2-JSON plugin and return JSON data from your action class.
Jquery already comes with a handy JSon parser mechanism and you can parse the returned List (converted in to JSON).