java - How do I iterate through an arraylist? -


i have getarray.jsp java code outputs array of form :

[{"value":"hi","id":"77","label":"hi there"}, {"value":"hello","id":"21","label":"hello there"}] 

the array declared in java :

arraylist<sometype> arr = new arraylist<sometype>(); 

i ajax load jsp :

$(document).ready(function (e) {     $('.container').load('getarray.jsp', function (responsetext, textstatus, xmlhttprequest) {         $.each(responsetext, function (index, response) {             $('.main').append(response.value);             $('.main').append('<br /><br /><br /><br />');         });     }); }); 

but not getting jquery print anything, though jsp return array mentioned on top.

i know json, how print it?


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -