0

I'm using a Java application with Google AppEngine. I send post requests to the servlet and it needs to response with some unknown number of URL's.

I was wondering what would be the best way to implement this. Making URL object in the app and sending it as JSON or then reconverting it in the Java application or just sending the URLs as String with some delimiter ?

Is there a way to send parameters in response objects like we do with request objects or maybe set the MIME type so we can get the URLs easily in the Java application ?

Saad Farooq
  • 13,172
  • 10
  • 68
  • 94

1 Answers1

0

I'd recommend just returning a JSON array; there are good libraries in Java (see Jackson Vs. Gson) to create JSON from Java objects and parsing JSON in javascript is obviously a solved problem. Relying on well-known code to do all the encoding/decoding is a huge help.

Community
  • 1
  • 1
Moishe Lettvin
  • 8,462
  • 1
  • 26
  • 40