Question

I need to write a function that gets a Json via Spring and deliver a Data. The case is that a customer is sending me a Filename and im looking in a database where the file is and send him the data. I only need a little kickstart and someone who can answer me to my Questions:

  • Do I really need Sockets for this?
  • What for a Stream I should use (Its several Datatypes likes Pictures, Documents, Pdf....)
  • How can I identify the Destination to send
Was it helpful?

Solution

You can use Response like this :

String yourData;
JsonWriter writer = new JsonWriter(response.getWriter());
    writer.beginObject();
    writer.name("data").value(yourData);
    writer.endObject();
    writer.close();
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top