Hi am developing an application in which servlet has to send data(coming from database) to applet i have fallowed this link
it is very useful but they mentioned passing
if you are going to create or read json strings, then I'd recommend using Google's Gson.
To send a json response from the servlet do this:
response.setContentType("application/json");
response.setCharacterEncoding("UTF-8");
PrintWriter writer = null;
try {
writer = response.getWriter();
writer.write(json);
} finally {
writer.close();
}