Code example for JSONObject

Methods: optString

0
    JSONObject payload = request.getPayload();
 
    String js = voidTemplate
            .replace(":sessionId", request.getSession())
            .replace(":reference", request.getVariableValue(":reference"))
            .replace("xstart", payload.optString("xstart"))
            .replace("ystart", payload.optString("ystart"))
            .replace("xend", payload.optString("xend"))
            .replace("yend", payload.optString("yend"))
            .replace("touchCountx", payload.optString("touchCount"));
 
 
    setJS(js);
 
 
  } 
 
  @Override 
  public JSONObject configurationDescription() throws JSONException {
    return null;  //To change body of implemented methods use File | Settings | File Templates. 
  }