Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //saving in JSON form
- JSONObject json=new JSONObject();
- JSONArray jarray=new JSONArray();
- JSONObject details;
- try
- {
- for(int i=0;i<10;i++)
- {
- details = new JSONObject();
- details.put("firstname:",fname);
- details.put("lastname:",lname);
- details.put("username:",uname);
- details.put("email:",email);
- details.put("password:",pswd);
- details.put("confirm password:",repswd);
- details.put("phonenumber:",phonenumber);
- details.put("security question:",SecurityQuestion);
- details.put("answer:",tarea);
- jarray.put(details);
- }
- json.put("details",jarray);
- }
- catch(JSONException e)
- {
- out.print("unable to save in JSON File");
- e.printStackTrace();
- }
- response.setContentType("application/json");
- response.getWriter().write(json.toString());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement