コード例 #1
0
  @Override
  protected Void doInBackground(Void... params) {

    if (configToLoad == UPDATE_SERVER) {
      SwitchBoard.updateConfigServerUrl(context);
    } else {
      if (uuid == null) SwitchBoard.loadConfig(context);
      else SwitchBoard.loadConfig(context, uuid);
    }

    return null;
  }
コード例 #2
0
  public void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException {
    ObjectMapper objectMapper = new ObjectMapper();
    String json = req.getParameter("message");
    System.out.print("function comes");
    System.out.print(json);
    SwitchBoard str = objectMapper.readValue(json, SwitchBoard.class);
    System.out.println("value setted");
    System.out.println(str.getButtonValue());
    System.out.println(str.getProblemdetails());
    PersistenceManager pm = PMF.get().getPersistenceManager();
    try {

      System.out.print("coming here");
      pm.makePersistent(str);

    } finally {
      System.out.print("made persistent");
      resp.setContentType("application/json");
      pm.close();
    }
    resp.setContentType("text/plain");
  }