aspose file tools*
The moose likes JSP and the fly likes Build Array in Servlet And Pass Back to Ajax Callback 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 » Java » JSP
Bookmark "Build Array in Servlet And Pass Back to Ajax Callback" Watch "Build Array in Servlet And Pass Back to Ajax Callback" New topic
Author

Build Array in Servlet And Pass Back to Ajax Callback

Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1391
I want to create an array in my Servlet and send return that array in my callback string. I will use the arry to display several pdf files.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60050
    
  65

JSON


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1391
Bear Bibeault wrote:JSON


Okay this is part of my Servlet:



The jReturnString looks like this:

{"errorString": "NoError", "filePath": "["\/\/gvas400\/home\/ShippingDocssupport\/Temp\/ShippingDocs\/8130\/2011\/_185049_999999_SSR101911 CO185049_000143689.pdf","\/\/gvas400\/home\/ShippingDocssupport\/Temp\/ShippingDocs\/8130\/2011\/_185049_999999_SSR101911 CO185049_000143690.pdf","\/\/gvas400\/home\/ShippingDocssupport\/Temp\/ShippingDocs\/8130\/2011\/_185049_999999_SSR101911 CO185049_000143691.pdf"]"}

The JSON seems to be modifing the "\\"

Something is preventing my call back function from fireing.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60050
    
  65

Usually that means that the JSON is invalid.

I see that you are building your JSON by hand. Don't. Let a library such as Google's Gson handle the JSON conversion.
 
Don't get me started about those stupid light bulbs.
 
subject: Build Array in Servlet And Pass Back to Ajax Callback
 
Similar Threads
jQuery load with Callback
listen to events from a servlet in an embedded tomcat
Passing a json object from servlet
Servlet can't get the xmlhttp post request
Using Values in a List form one JSP to Another