aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes ArrayList in http response. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "ArrayList in http response." Watch "ArrayList in http response." New topic
Author

ArrayList in http response.

Jigar Naik
Ranch Hand

Joined: Dec 12, 2006
Posts: 755
Hi,

I want to pass ArrayList(from servlet) in HttpResponse(To JSP)(Ajax).

arraylist contains the list of POJO instances..

can anybody help me out ???


Jigar Naik


Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
The call back is plain string.

Question for you is what would you normally do to display this information on a normal page? Probably loop through the info some how?

Well you need to loop through the data and make it in some readable format that you can use on the client. Either you make some sort of string format that can be parsed, or you look into JSON.

Eric
Jigar Naik
Ranch Hand

Joined: Dec 12, 2006
Posts: 755
okis gotcha... thanks...
Jigar Naik
Ranch Hand

Joined: Dec 12, 2006
Posts: 755
now i have looped in my servlet and created a responseText like the bellow

res = "<option>xxxx</option><option>yyyy</option><option>xxxx</option>";


<script>
....
....
....
var res = responseText; //res = "<option>xxxx</option><option>yyyy</option><option>xxxx</option>";
....
....
....
....
<script>



Now that i have got the html String but how will i display the response in my html body part ???
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ArrayList in http response.