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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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: 751
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: 751
okis gotcha... thanks...
Jigar Naik
Ranch Hand

Joined: Dec 12, 2006
Posts: 751
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.
 
Similar Threads
why some classes are called deprecated & some legacy?
Collections.copy method for lists ? how it works
Arraylist Vs LinkedHashMap
How do you avoid an ArrayList object from being modified, i.e. avoid adding and deleting its content
readonly ArrayList