Advertisement
Lauda

JSONMsgServlet

Jul 3rd, 2014
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.43 KB | None | 0 0
  1. public JSONArray genJSONData(String msg, String msgType, Boolean b, String url)
  2.     {
  3.         JSONArray tmpArray = new JSONArray();
  4.         JSONObject main = new JSONObject();
  5.        
  6.         try {
  7.         main.put("message", msg);
  8.         main.put("err", b);
  9.         main.put("url", url);
  10.         main.put("msgType", msgType);
  11.         tmpArray.put(main);
  12.        
  13.         } catch (JSONException e) {
  14.             // TODO Auto-generated catch block
  15.             e.printStackTrace();
  16.         }
  17.        
  18.         return tmpArray;
  19.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement