how to send jsp array to Ajax?
Is there a way to return an array of strings from jsp to Ajax? How can I send it to the Ajax and read it as
xmlhttp开发者_如何学编程.responseText
I would suggest that you look into JSON as your transport format. Encode your Java String array into JSON and send this to your Javascript. It's a very lightweight format and there exist tons of Javascript frameworks (jQuery, mootools, dojo, you name it) that make working with it a pleasure.
DWR can be used to send array of strings to AJAX .
Using DWR for AJAX example
Easy Ajax for Java (DWR)
精彩评论