开发者

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)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜