java - How to send Data from Tomcat Server to Client? -


i need write function gets json via spring , deliver data. case customer sending me filename , im looking in database file , send him data. need little kickstart , can answer me questions:

  • do need sockets this?
  • what stream should use (its several datatypes likes pictures, documents, pdf....)
  • how can identify destination send

you can use response :

string yourdata; jsonwriter writer = new jsonwriter(response.getwriter());     writer.beginobject();     writer.name("data").value(yourdata);     writer.endobject();     writer.close(); 

Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -